function zipf_cdf_test ( )

%*****************************************************************************80
%
%% ZIPF_CDF_TEST tests ZIPF_CDF, ZIPF_CDF_INV, ZIPF_PDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    08 March 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ZIPF_CDF_TEST\n' );
  fprintf ( 1, '  ZIPF_PDF evaluates the Zipf PDF.\n' );
  fprintf ( 1, '  ZIPF_CDF evaluates the Zipf CDF.\n' );
  fprintf ( 1, '  ZIPF_CDF_INV inverts the Zipf CDF.\n' );

  a = 2.0;

  check = zipf_check ( a );

  if ( ~check );
    fprintf ( 1, '\n' );
    fprintf ( 1, 'ZIPF_CDF_TEST - Fatal error!\n' );
    fprintf ( 1, '  The parameters are not legal.\n' );
    return
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF parameter A = %14f\n', a );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       X          PDF(X)          CDF(X)  CDF_INV(CDF)\n' );
  fprintf ( 1, '\n' );

  for x = 1 : 20

    pdf = zipf_pdf ( x, a );
    cdf = zipf_cdf ( x, a );
    x2 = zipf_cdf_inv ( a, cdf );
    fprintf ( 1, '  %6d  %14g  %14g  %6d\n', x, pdf, cdf, x2 );

  end

  return
end
