function monte_carlo_regular_test ( )

%*****************************************************************************80
%
%% MONTE_CARLO_REGULAR_TEST tests the Monte Carlo rule on the regular integrand.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    17 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'MONTE_CARLO_REGULAR_TEST\n' );
  fprintf ( 1, '  Test the Monte Carlo rule on the regular integrand.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        N        Estimate           Error\n' );
  fprintf ( 1, '\n' );
  seed = 123456789;
  n = 17;
  v2 = integral_regular ( );
  for nlog = 5 : 20
    n = ( n - 1 ) * 2 + 1;
    h = 1.0 / ( n );
%   x = rand ( n, 1 );
    [ x, seed ] = r8vec_uniform_01 ( n, seed );
    f = integrand_regular ( n, x );
    v1 = h * sum ( f );
    fprintf ( 1, '  %7d  %14.6g  %14.6g\n', n, v1, abs ( v1 - v2 ) );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '    Exact: %14.6g\n', v2 );

  return
end

