function truncated_normal_a_cdf_inv_test ( )

%*****************************************************************************80
%
%% truncated_normal_a_cdv_inv_test() tests truncated_normal_a_cdf_inv().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 March 2015
%
%  Author:
%
%    John Burkardt
%
  sample_num = 10;
  a = 50.0;
  mu = 100.0;
  sigma = 25.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'truncated_normal_a_cdf_inv_test():\n' );
  fprintf ( 1, '  truncated_normal_a_cdf_inv() inverts the CDF\n' );
  fprintf ( 1, '  for the lower Truncated Normal Distribution.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The "parent" normal distribution has\n' );
  fprintf ( 1, '    mean =               %g\n', mu );
  fprintf ( 1, '    standard deviation = %g\n', sigma );
  fprintf ( 1, '  The parent distribution is truncated to\n' );
  fprintf ( 1, '  the interval [%g,+00)\n', a );

  fprintf ( 1, '\n' );
  fprintf ( 1, '       X            CDF           CDF_INV\n' );
  fprintf ( 1, '\n' );

  for i = 1 : sample_num
    x = truncated_normal_a_sample ( mu, sigma, a );
    cdf = truncated_normal_a_cdf ( x, mu, sigma, a );
    x2 = truncated_normal_a_cdf_inv ( cdf, mu, sigma, a );
    fprintf ( 1, '  %14.6g  %14.6g  %14.6g\n', x, cdf, x2 );
  end

  return
end
