function ranlib_test_gennor ( phrase )

%*****************************************************************************80
%
%% RANLIB_TEST_GENNOR tests GENNOR, which generates normal deviates.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    01 April 2013
%
%  Author:
%
%    John Burkardt
%
  n = 1000;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'RANLIB_TEST_GENNOR\n' );
  fprintf ( 1, '  Test GENNOR,\n' );
  fprintf ( 1, '  which generates normal deviates.\n' );
%
%  Initialize the generators.
%
  initialize ( );
%
%  Set the seeds based on the phrase.
%
  [ seed1, seed2 ] = phrtsd ( phrase );
%
%  Initialize all generators.
%
  set_initial_seed ( seed1, seed2 );
%
%  Select the parameters at random within a given range.
%
  low = -10.0;
  high = 10.0;
  mu = genunf ( low, high );

  low = 0.25;
  high = 4.0;
  sd = genunf ( low, high );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  N = %d\n', n );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Parameters:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  MU =   %g\n', mu );
  fprintf ( 1, '  SD =   %g\n', sd );
%
%  Generate N samples.
%
  for i = 1 : n
    array(i) = gennor ( mu, sd );
  end
%
%  Compute statistics on the samples.
%
  [ av, var, xmin, xmax ] = stats ( array, n );
%
%  Request expected value of statistics for this distribution.
%
  pdf = 'nor';
  param(1) = mu;
  param(2) = sd;

  [ avtr, vartr ] = trstat ( pdf, param );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sample data range:          %14.6g  %14.6g\n', xmin, xmax );
  fprintf ( 1, '  Sample mean, variance:      %14.6g  %14.6g\n', av,   var );
  fprintf ( 1, '  Distribution mean, variance %14.6g  %14.6g\n', avtr, vartr );

  return
end
