-
Notifications
You must be signed in to change notification settings - Fork 100
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
Fix logabsbeta
for BigFloat
#325
Conversation
Test failures are the same as on the master branch, it seems. |
I'm lost, are they due to #319? Is there anything we can do to have a usable state? |
Hopefully #327 fixes it. |
Codecov Report
@@ Coverage Diff @@
## master #325 +/- ##
==========================================
- Coverage 92.70% 92.66% -0.04%
==========================================
Files 12 12
Lines 2645 2646 +1
==========================================
Hits 2452 2452
- Misses 193 194 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
src/beta_inc.jl
Outdated
|
||
_loggammadiv(a::Number, b::Number) = loggamma(b) - loggamma(a + b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be useful to add a comment here as a reminder that a proper implementation should be added at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment.
This PR adds a fallback definition for
_loggammadiv
. This fixes test errors in TuringLang/DistributionsAD.jl#172.Motivation:
Version 1.4.1, or more concretely #316 (@andreasnoack), caused some regressions of
logbeta
andlogabsbeta
withBigFloat
s.On 1.4.0:
On 1.4.1:
beta
still works since it uses the definition in mpfr on my machine. Actually, the problem was present in SpecialFunctions 1.4.0 as well but it is easier to trigger it in 1.4.1 since the branch is chosen not only for inputs with large difference in magnitude anymore (on 1.4.0:SpecialFunctions.jl/src/gamma.jl
Line 842 in feccbf4
SpecialFunctions.jl/src/gamma.jl
Line 821 in dd41481
On 1.4.0:
With this PR all examples work: