function nakagami_cdf_test ( )

%*****************************************************************************80
%
%% NAKAGAMI_CDF_TEST tests NAKAGAMI_CDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    03 August 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'NAKAGAMI_CDF_TEST\n' );
  fprintf ( 1, '  NAKAGAMI_CDF evaluates the Nakagami CDF;\n' );
  fprintf ( 1, '  NAKAGAMI_PDF evaluates the Nakagami PDF;\n' );

  a = 1.0;
  b = 2.0;
  c = 3.0;

  check = nakagami_check ( a, b, c );

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

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

  for i = 1 : 10

    x = a + b + sqrt ( i / c / 10.0 );

    pdf = nakagami_pdf ( x, a, b, c );

    cdf = nakagami_cdf ( x, a, b, c );

    x2 = nakagami_cdf_inv ( cdf, a, b, c );

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

  end

  return
end
