-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Description
While using quantile(d::Gamma, q::Real) I ran into an error from gamma_inc_inv with the following inputs
k = 0.0016546512046778552
p = 0.29292929292929293
x = gamma_inc_inv(k, p, 1-p)
ERROR: DomainError with -9.5893e-320:
log will only return a complex result if called with a complex argument. Try log(Complex(x)).
Stacktrace:
[1] throw_complex_domainerror(f::Symbol, x::Float64)
@ Base.Math .\math.jl:33
[2] _log(x::Float64, base::Val{:ℯ}, func::Symbol)
@ Base.Math .\special\log.jl:304
[3] log
@ .\special\log.jl:269 [inlined]
[4] __gamma_inc_inv(a::Float64, minpq::Float64, pcase::Bool)
@ SpecialFunctions C:\Users\user\.julia\packages\SpecialFunctions\oPGFg\src\gamma_inc.jl:1048
[5] _gamma_inc_inv
@ C:\Users\user\.julia\packages\SpecialFunctions\oPGFg\src\gamma_inc.jl:1012 [inlined]
[6] gamma_inc_inv(a::Float64, p::Float64, q::Float64)
@ SpecialFunctions C:\Users\user\.julia\packages\SpecialFunctions\oPGFg\src\gamma_inc.jl:994
this is such a small number, it's BARELY negative, so it looks like some sort of round-off error in an internal iteration surrounding gamma_inc.jl:1048. I see there's an abs(x)
expression on line 1086,
SpecialFunctions.jl/src/gamma_inc.jl
Line 1086 in 49be7e6
t = abs(x/x0 - 1.0) |
would it be safe to stick one on line 1088 as well?
SpecialFunctions.jl/src/gamma_inc.jl
Line 1088 in 49be7e6
x = x0 |
Metadata
Metadata
Assignees
Labels
No labels