@@ -725,14 +725,13 @@ function gamma_inc_inv_qsmall(a::Float64, q::Float64)
725
725
end
726
726
727
727
"""
728
- gamma_inc_inv_asmall(a, minpq, pcase )
728
+ gamma_inc_inv_asmall(a, logp )
729
729
730
730
Compute `x0` - initial approximation when `a` is small.
731
- Here the solution `x` of ``P(a,x)=p`` satisfies ``x_{l} < x < x_{u}``
731
+ Here the solution `x` of ``P(a,x)=p= \\ exp(logp) `` satisfies ``x_{l} < x < x_{u}``
732
732
where ``x_{l} = (p\\ Gamma(a+1))^{1/a}`` and ``x_{u} = -\\ log{(1 - p\\ Gamma(a+1))}``, and is used as starting value for Newton iteration.
733
733
"""
734
- function gamma_inc_inv_asmall (a:: Float64 , minpq:: Float64 , pcase:: Bool )
735
- logp = pcase ? log (minpq) : log1p (- minpq)
734
+ function gamma_inc_inv_asmall (a:: Float64 , logp:: Float64 )
736
735
return exp ((logp + loggamma1p (a)) / a)
737
736
end
738
737
@@ -952,7 +951,7 @@ function __gamma_inc_inv(a::Float64, minpq::Float64, pcase::Bool)
952
951
elseif abs (a - 1.0 ) < 1.0e-4
953
952
x0 = pcase ? - log1p (- minpq) : - log (minpq)
954
953
elseif a < 1.0 # small value of a
955
- x0 = gamma_inc_inv_asmall (a, minpq, pcase )
954
+ x0 = gamma_inc_inv_asmall (a, logp )
956
955
else # large a
957
956
haseta = true
958
957
x0, fp = gamma_inc_inv_alarge (a, minpq, pcase)
0 commit comments