function cdf = levy_cdf ( x, a, b )

%*****************************************************************************80
%
%% levy_cdf() evaluates the Levy CDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 January 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X, the argument of the CDF.
%    Normally, A <= X.
%
%    real A, B, the parameters of the PDF.
%    0 < B.
%
%  Output:
%
%    real CDF, the value of the PDF.
%
  if ( b <= 0.0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, '  LEVY_PDF - Fatal error!\n' );
    fprintf ( 1, '  Input parameter B <= 0.0\n' );
    error ( 'LEVY_PDF - Fatal error!' );
  end

  if ( x <= a )
    cdf = 0.0;
  else
    cdf = 1.0 - erf ( sqrt ( b / ( 2.0 * ( x - a ) ) ) );
  end

  return
end
