function frechet_cdf_test ( )

%*****************************************************************************80
%
%% frechet_cdf_test() tests frechet_cdf().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 September 2008
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'FRECHET_CDF_TEST():\n' );
  fprintf ( 1, '  FRECHET_CDF() evaluates the Frechet CDF;\n' );
  fprintf ( 1, '  FRECHET_CDF_INV() inverts the Frechet CDF.\n' );
  fprintf ( 1, '  FRECHET_PDF() evaluates the Frechet PDF;\n' );

  alpha = 3.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF parameter ALPHA =         %g\n', alpha );

  fprintf ( 1, '\n' );
  fprintf ( 1,'       X            PDF           CDF            CDF_INV\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 10

    x = frechet_sample ( alpha );

    pdf = frechet_pdf ( x, alpha );

    cdf = frechet_cdf ( x, alpha );

    x2 = frechet_cdf_inv ( cdf, alpha );

    fprintf ( 1, '  %12g  %12g  %12g  %12g\n',x, pdf, cdf, x2 );

  end

  return
end
