function cc_precision ( )

%*****************************************************************************80
%
%% CC_PRECISION uses a sequence of Clenshaw-Curtis rules on 3 integrands.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    25 February 2013
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CC_TEST:\n' );
  fprintf ( 1, '  Use Clenshaw-Curtis rules of increasing order\n' );
  fprintf ( 1, '  and look at precision of quadrature.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   N    1+2x+3x^2+4x^3    exp(x)        x^7\n' );
  fprintf ( 1, '\n' );

  t(1) = 4.0;
  t(2) = exp ( 1.0 ) - 1.0;
  t(3) = 1.0;

  for n = 1 : 10

    [ x, w ] = clenshaw_curtis_compute ( n );
%
%  Shift X and W from [-1,+1] to [0,1].
%
    x = ( x + 1.0 ) / 2.0;
    w = ( w / 2.0 );
%
%  Evaluate function, compute quadrature formula and error.
%
    fx = 1 + 2 * x + 3 * x.^2 + 4 * x.^3;
    q = w' * fx;
    e(1) = abs ( q - t(1) );

    fx = exp ( x );
    q = w' * fx;
    e(2) = abs ( q - t(2) );

    fx = 8 * x.^7;
    q = w' * fx;
    e(3) = abs ( q - t(3) );
    fprintf ( 1, '  %2d  %12g  %12g  %12g\n', n, e(1:3) );

  end

  return
end


