function p01_polynomial_value_test ( )

%*****************************************************************************80
%
%% p01_polynomial_value_test() tests p01_polynomial_value().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 March 2012
%
%  Author:
%
%    John Burkardt
%
  m = 1;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'p01_polynomial_value_test():\n' );
  fprintf ( 1, '  p01_polynomial_value() evaluates the shifted Legendre polynomial P01(n,x).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '                        Tabulated                 Computed\n' );
  fprintf ( 1, '     N        X          P01(N,X)                 P01(N,X)                     Error\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

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

    if ( n_data == 0 )
      break
    end

    v = p01_polynomial_value ( m, n, x );
    fx2 = v(1,n+1);

    e = fx1 - fx2;

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

  end

  return
end
