function r8_randgs_test ( )

%*****************************************************************************80
%
%% R8_RANDGS_TEST tests R8_RANDGS.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 April 2016
%
%  Author:
%
%    John Burkardt
%
  m = 3.0;
  sd = 2.0;
  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_RANDGS_TEST:\n' );
  fprintf ( 1, '  R8_RANDGS is a normal random number generator.\n' );
  fprintf ( 1, '  Mean = %g\n', m );
  fprintf ( 1, '  Standard Deviation = %g\n', sd );
  fprintf ( 1, '\n' );
  fprintf ( 1, '             I         R8_RANDGS\n' );
  fprintf ( 1, '\n' );

  m2 = 0.0;
  sd2 = 0.0;

  for i = 1 : 1000

    [ r, seed ] = r8_randgs ( m, sd, seed );
    m2 = m2 + r;
    sd2 = sd2 + ( r - m ) ^ 2;
    if ( i <= 10 )
      fprintf ( 1, '  %14d  %14g\n', i, r );
    end

  end

  m2 = m2 / 1000.0;
  sd2 = sqrt ( sd2 / 1000.0 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sequence mean =  %g\n', m2 );
  fprintf ( 1, '  Sequence standard deviation = %g\n', sd2 );

  return
end