function asa241_test ( )

%*****************************************************************************80
%
%% asa241_test() tests asa241().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 November 2020
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../asa241' )

  timestamp (  );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'asa241_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test asa241()\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Let FX = NormalCDF ( X ).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  normal_01_cdf_values() returns some values of ( X, FX ).\n' );
  fprintf ( 1, '  r8_normal_01_cdf_inverse() takes FX, and computes an\n' );
  fprintf ( 1, '  estimate X2, of the corresponding input argument,\n' );
  fprintf ( 1, '  accurate to about 16 decimal places.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '      X                       FX               X2\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

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

    if ( n_data == 0 )
      break;
    end

    x2 = r8_normal_01_cdf_inverse ( fx );

    fprintf ( 1, '  %22.16e  %22.16e  %22.16e\n', x, fx, x2 );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'asa241_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../asa241' )

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

