function gegenbauer_exactness_test ( )

%*****************************************************************************80
%
%% gegenbauer_exactness_test() tests rules for the Gegenbauer integral.
%
%  Discussion:
%
%    The Gegenbauer integral includes a parameter LAMBDA.  Thus the
%    corresponding quadrature rules depend both on the order and LAMBDA.
%    Thus it is usual to compute a particular rule when needed, rather
%    than trying to maintain tabulated data.  Here, we simply supply
%    precomputed rules of orders 1 through 5 for the case LAMBDA = 1.75.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 January 2015
%
%  Author:
%
%    John Burkardt
%
  lambda = 1.75;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'GEGENBAUER_EXACTNESS_TEST\n' );
  fprintf ( 1, '  Test quadrature rules for the Gegenbauer integral.\n' );
  fprintf ( 1, '  Density function rho(x) = (1-x^2)^(lambda-1/2).\n' );
  fprintf ( 1, '  Using LAMBDA = %g\n', lambda );
  fprintf ( 1, '  Region: -1 <= x <= +1.\n' );
  fprintf ( 1, '  Exactness: 2*N-1.\n' );

  for n = 1 : 5

    if ( n == 1 )
      x = [ ...
        0.0000000000000000 ];
      w = [ ...
        1.2485988353771993 ];
    elseif ( n == 2 )
      x = [ ...
       -0.4264014327112208, ...
        0.4264014327112208 ];
      w = [ ...
        0.6242994176885995, ...
        0.6242994176885995 ];
    elseif ( n == 3 )
      x = [ ...
       -0.6324555320336757, ...
        0.0000000000000000, ...
        0.6324555320336757 ];
      w = [ ...
        0.2837724625857273, ...
        0.6810539102057455, ...
        0.2837724625857273 ];
    elseif ( n == 4 )
      x = [ ...
       -0.7455376618816977, ...
       -0.2752317970082527, ...
        0.2752317970082527, ...
        0.7455376618816980 ];
      w = [ ...
        0.1379302690657785, ...
        0.4863691486228214, ...
        0.4863691486228208, ...
        0.1379302690657786 ];
    elseif ( n == 5 )
      x = [ ...
       -0.8137803260309515, ...
       -0.4553315257658559, ...
        0.0000000000000001, ...
        0.4553315257658557, ...
        0.8137803260309517 ];
      w = [ ...
        0.0725955752894624, ...
        0.3156051535278124, ...
        0.4721973777426502, ...
        0.3156051535278118, ...
        0.0725955752894624 ];
    end

    p_max = 2 * n;
    gegenbauer_exactness ( n, x, w, p_max, lambda );

  end

  return
end
