function v_polynomial_test ( )

%*****************************************************************************80
%
%% V_POLYNOMIAL_TEST tests V_POLYNOMIAL.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 February 2012
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'V_POLYNOMIAL_TEST:\n' );
  fprintf ( 1, '  V_POLYNOMIAL evaluates the Chebyshev polynomial V(n,x).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '                        Tabulated                 Computed\n' );
  fprintf ( 1, '     N        X           V(n,x)                    V(n,x)                     Error\n' );

  fprintf ( 1, '\n' );

  n_data = 0;

  while ( 1 )

    [ n_data, n, x, fx1 ] = v_polynomial_values ( n_data );

    if ( n_data == 0 )
      break
    end

    if ( n < 0 )
      continue
    end

    fx2_vec = v_polynomial ( 1, n, x );
    fx2 = fx2_vec(1,n+1);
    e = fx1 - fx2;

    fprintf ( 1, '  %4d  %12g  %24.16g  %24.16g  %8.2g\n', n, x, fx1, fx2, e );

  end

  return
end
