function gaussint_test ( )

%*****************************************************************************80
%
%% gaussint_test tests gaussint.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 June 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gaussint_test:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test gaussint():\n' );
%
%  f(x) = exp(-x^2)
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimate integral of exp(-x^2) over [0,2]\n' );
  fprintf ( 1, '\n' );
  a = 0.0;
  b = 2.0;
  n = 1;
  index_f = 1;
  for i = 1 : 5
    [ val, bp, wf ] = gaussint ( a, b, n, index_f );
    fprintf ( 1, '  %2d  %24.16g\n', n, val );
    n = 2 * n;
  end
%
%  f(x) = 1/(1+x^2)
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimate integral of 1/(1+x^2) over [0,4]\n' );
  fprintf ( 1, '\n' );
  a = 0.0;
  b = 4.0;
  n = 1;
  index_f = 2;
  for i = 1 : 6
    [ val, bp, wf ] = gaussint ( a, b, n, index_f );
    fprintf ( 1, '  %2d  %24.16g\n', n, val );
    n = 2 * n;
  end
%
%  f(x) = 1/(2+sin(x))
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimate integral of 1/(2+sin(x)) over [0,pi]\n' );
  fprintf ( 1, '\n' );
  a = 0.0;
  b = pi;
  n = 1;
  index_f = 3;
  for i = 1 : 5
    [ val, bp, wf ] = gaussint ( a, b, n, index_f );
    fprintf ( 1, '  %2d  %24.16g\n', n, val );
    n = 2 * n;
  end
%
%  f(x) = exp(cos(x))
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimate integral of exp(cos(x)) over [0,pi]\n' );
  fprintf ( 1, '\n' );
  a = 0.0;
  b = pi;
  n = 1;
  index_f = 4;
  for i = 1 : 6
    [ val, bp, wf ] = gaussint ( a, b, n, index_f );
    fprintf ( 1, '  %2d  %24.16g\n', n, val );
    n = 2 * n;
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gaussint_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

