function rng_cliff_test02 ( )

%*****************************************************************************80
%
%% rng_cliff_test02() tests rng_cliff_next().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    12 August 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rng_cliff_test02()\n' );
  fprintf ( 1, '  rng_cliff_next computes the next entry in the\n' );
  fprintf ( 1, '  Cliff pseudorandom number generator sequence.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Generate a sequence of length n.\n' );
  fprintf ( 1, '  Compute mean and standard deviation.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       n        mean         std\n' );
  fprintf ( 1, '\n' );

  n = 10;
%
%  Octave can't handle the larger values of n_log.
%
% for n_log = 1 : 7
  for n_log = 1 : 5

    rvec = zeros ( n, 1 );

    r(1) = 0.5;
    for i = 2 : n
      r(i) = rng_cliff_next ( r(i-1) );
    end

    fprintf ( 1, '  %8d  %10.6f  %10.6f\n', n, mean ( r ), std ( r ) );

    n = n * 10;

  end

  return
end
