function nprob_test ( )

%*****************************************************************************80
%
%% nprob_test() tests nprob().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'nprob_test():\n' );
  fprintf ( 1, '  Compare tabulated values of the normal\n' );
  fprintf ( 1, '  Cumulative Density Function against values\n' );
  fprintf ( 1, '  computed by nprob().\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '         X        CDF                       CDF' );
  fprintf ( 1, '                    DIFF\n' );
  fprintf ( 1, '               (tabulated)                 (NPROB)\n' );
  fprintf ( 1, '\n' );

  upper = 0;
  n_data = 0;

  while ( true )

    [ n_data, x, fx ] = normal_01_cdf_values ( n_data );

    if ( n_data == 0 )
      break
    end

    [ p, q, pdf ] = nprob ( x );
    fx2 = p;

    fprintf ( 1, '  %10.4e  %24.16e  %24.16e  %10.4e\n', ...
    x, fx, fx2, abs ( fx - fx2 ) );

  end

  return
end
