function trap_test ( )

%*****************************************************************************80
%
%% trap_test test trap.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 June 2019
%
%  Author:
%
%    John Burkardt
%%
%  Reference:
%
%    Samuel Conte, Carl de Boor,
%    Elementary Numerical Analysis,
%    Third Edition,
%    SIAM, 2017,
%    ISBN: 978-1-611975-19-2.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'trap_test:\n' );
  fprintf ( 1, '  Test trap()\n' );

  a = 0.0;
  b = 2.0;
  n = 1;

  fprintf ( 1, '\n' );
  fprintf ( 1, '       N    Integral estimate\n' );
  fprintf ( 1, '\n' );
  for logn = 1 : 10
    n = 2 * n;    
    estimate = trap ( @humps_cd, a, b, n );
    fprintf ( 1, '  %6d  %20.12g\n', n, estimate );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'trap_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
  
