function asa266_test05 ( )

%*****************************************************************************80
%
%% asa266_test05() tests alogam(), r8_gamma_log(), lngamma();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 January 2021
%
%  Author:
%
%    John Burkardt
%
  ntest = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'asa266_test05():\n' );
  fprintf ( 1, '  alogam(),\n' );
  fprintf ( 1, '  gammaln(),\n' );
  fprintf ( 1, '  lngamma() compute the logarithm of the gamma function.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  X  ALOGAM  R8_GAMMA_LOG LNGAMMA\n' );
  fprintf ( 1, '\n' );

  for i = 1 : ntest

    x = i / ntest;

    [ log2, ifault ] = alogam ( x );
    log3 = gammaln ( x );
    [ log4, ifault ] = lngamma ( x );

    fprintf ( 1, '  %12f  %12f  %12f  %12f\n', ...
      x, log2, log3, log4 );

  end

  return
end
