function triangle_integrands_test02 ( )

%*****************************************************************************80
%
%% triangle_integrands_test02() tests p00_monte_carlo().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 July 2018
%
%  Author:
%
%    John Burkardt
%
  exact = 1.0;
  n_log_max = 15;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_integrands_test02():\n' );
  fprintf ( 1, '  p00_monte_carlo() applies a Monte Carlo rule.\n' );

  prob_num = get_prob_num ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Problem            Exact\n' );
  fprintf ( 1, '           Pts       Approx        Error\n' );
  fprintf ( 1, '\n' );
%
%  Pick a problem.
%
  for problem = 1 : prob_num

    title = p00_title ( problem );

    fprintf ( 1, '\n' );
    fprintf ( 1, '%s\n', title );
    fprintf ( 1, '%8d        %12f\n', problem, exact );
    fprintf ( 1, '\n' );
%
%  Pick a number of points.
%
    for n_log = 0 : n_log_max

      n = 2^n_log;

      result = p00_monte_carlo ( problem, n );

      abs_error = abs ( exact - result );

      fprintf ( 1, '      %8d  %12f  %12f\n', n, result, abs_error );

    end

  end

  return
end
