function lgndre_test ( )

%*****************************************************************************80
%
%% lgndre_test test lgndre.
%
%  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, 'lgndre_test:\n' );
  fprintf ( 1, '  Test lgndre()\n' );

  a = 0.0;
  b = 2.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '       N    Integral estimate\n' );
  fprintf ( 1, '\n' );
  for n = 1 : 10
    rule = lgndre ( n );
    x = rule.points;
    w = rule.weights;
    x = ( ( 1.0 - x ) * a + ( 1.0 + x ) * b ) / 2.0;
    w = w * ( b - a ) / 2.0;
    estimate = w * ( humps_cd ( x ) )';
    fprintf ( 1, '  %6d  %20.12g\n', n, estimate );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'lgndre_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
  
