function filon_test03 ( )

%*****************************************************************************80
%
%% filon_test03() tests filon_fun_cos().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 May 2014
%
%  Author:
%
%    John Burkardt
%

%
%  Example suggested by James Roedder.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'FILON_TEST03\n' );
  fprintf ( 1, '  Integrate F(X)=log(1+X)*cos(T*X):\n' );
  fprintf ( 1, '  Supply integrand as a function.\n' );
  fprintf ( 1, '  T = 10, and N increases\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       N    Approximate             Exact                   Error\n' );
  fprintf ( 1, '\n' );

  a = 0.0;
  b = 2.0 * pi;

  for j = 1 : 6

    n = 2 ^ j * 10 + 1;
 
    t = 10.0;

    result = filon_fun_cos ( n, @log_integrand, a, b, t );

    exact = -0.008446594405;
    error = result - exact;

    fprintf ( 1, '  %6d  %22.16g  %22.16g  %10.4e\n', ...
      n, result, exact, error );

  end

  return
end
