function clausen_test ( )

%*****************************************************************************80
%
%% clausen_test() tests clausen().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 December 2018
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../clausen' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'clausen_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s.\n', version ( ) );
  fprintf ( 1, '  clausen() evaluates the Clausen function.\n' );
  fprintf ( 1, '  Compare its results to tabulated data.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '                               Tabulated               Computed\n' );
  fprintf ( 1, '             X                        FX                     FX        Diff\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, x, fx1 ] = clausen_values ( n_data );

    if ( n_data == 0 )
      break
    end

    fx2 = clausen ( x );

    e = abs ( fx1 - fx2 );

    fprintf ( 1, '  %12f  %24.16f  %24.16f  %6.1e\n', x, fx1, fx2, e );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'clausen_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../clausen' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

