function glpair_test ( )

%*****************************************************************************80
%
%% glpair_test() tests glpair().
%
%  Discussion:
%
%    Test the numerical integration of ln(x) over the range [0,1]
%    Normally, one would not use Gauss-Legendre quadrature for this,
%    but for the sake of having an example with l > 100, this is included.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 January 2016
%
%  Author:
%
%    Original C++ version by Ignace Bogaert.
%    This version by John Burkardt.
%
%  Reference:
%
%    Ignace Bogaert,
%    Iteration-free computation of Gauss-Legendre quadrature nodes and weights,
%    SIAM Journal on Scientific Computing,
%    Volume 36, Number 3, 2014, pages A1008-1026.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'glpair_test():\n' );
  fprintf ( 1, '  Estimate integral ( 0 <= x <= 1 ) ln(x) dx.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    Nodes           Estimate\n' );
  fprintf ( 1, '\n' );

  l = 1;
  for p = 0 : 6
    q = 0.0E+00;
    for k = 1 : l
      [ theta, weight, x ] = glpair ( l, k );
      q = q + 0.5E+00 * weight * log ( 0.5E+00 * ( x + 1.0E+00 ) );
    end
    fprintf ( 1, '  %7d       %24.16g\n', l, q );
    l = l * 10;
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '    Exact        -1.0\n' );

  return
end


