function x = gompertz_cdf_inv ( cdf, a, b )

%*****************************************************************************80
%
%% gompertz_cdf_inv() inverts the Gompertz CDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 January 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Johnson, Kotz, Balakrishnan,
%    Continuous Univariate Distributions, Volume 2, second edition,
%    Wiley, 1994, pages 25-26.
%
%  Input:
%
%    real CDF, the value of the CDF.
%
%    real A, B, the parameters of the PDF.
%    1 < A, 0 < B.
%
%  Output:
%
%    real X, the corresponding argument.
%
  if ( cdf < 0.0 )
    x = 0.0;
  elseif ( cdf < 1.0 )
    x = log ( 1.0 - log ( 1.0 - cdf ) * log ( a ) / b  ) / log ( a );
  else
    x = Inf;
  end

  return
end
