function w_polynomial_value_test ( )

%*****************************************************************************80
%
%% W_POLYNOMIAL_VALUE_TEST tests W_POLYNOMIAL_VALUE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    11 July 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'W_POLYNOMIAL_VALUE_TEST:\n' );
  fprintf ( 1, '  W_POLYNOMIAL_VALUE evaluates the Chebyshev polynomial W(n,x).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '                        Tabulated                 Computed\n' );
  fprintf ( 1, '     N        X           W(n,x)                    W(n,x)                     Error\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( 1 )

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

    if ( n_data == 0 )
      break
    end

    fx2 = w_polynomial_value ( n, x );
    e = fx1 - fx2;

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

  end

  return
end
