Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compute incomplete gamma function for some arguments #71

Closed
araujoms opened this issue Mar 28, 2024 · 1 comment · Fixed by #72
Closed

Cannot compute incomplete gamma function for some arguments #71

araujoms opened this issue Mar 28, 2024 · 1 comment · Fixed by #72

Comments

@araujoms
Copy link
Contributor

araujoms commented Mar 28, 2024

Essentially the same issue as JuliaMath/DoubleFloats.jl#183

If I call gamma(Float128(a),x) for x >= 3 I get an error, because gamma goes to a branch where it uses the function logabsgamma, which is not defined for Float128. This comes from the deprecation of lgamma and its replacement with loggamma and logabsgamma.

In DoubleFloats I fixed this by defining the function in terms of its BigFloat version. I could do the same here or, if you prefer, define it in terms of the Float128 version of lgamma with something like

function logabsgamma(x::Float128)
    sign = x >= 0 ? 1 : 2*mod(ceil(Int64,x),2)-1
    return lgamma(x), sign
end

It would also be nice to define a loggamma function with the same behaviour of the SpecialFunctions one for consistency.

@RalphAS
Copy link
Collaborator

RalphAS commented Mar 29, 2024

The version using only Float128 is preferable, and I agree that we should make the related API compatible with SpecialFunctions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants