Opened 8 years ago
Closed 5 years ago
#15196 closed defect (duplicate)
Use mpmath for numerical evaluation of the beta function
Reported by: | eviatarbach | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.3 |
Component: | numerical | Keywords: | |
Cc: | burcin, paulmasson, rws | Merged in: | |
Authors: | Ralf Stephan | Reviewers: | Paul Masson |
Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #21034 | Stopgaps: | incorrectAnswer |
Description (last modified by )
Currently,
sage: beta(-1.3,-0.4) NaN sage: (gamma(-1.3) * gamma(-0.4)) / gamma(-1.3 - 0.4) # expected functionality -4.92909641669610
This is because GiNaC uses exp(log_gamma(-1.3)+log_gamma(-0.4)-log_gamma(-1.3-0.4))
to evaluate, and log_gamma
is broken for some input (see #12521). Using mpmath is faster and avoids roundoff errors as well.
The ticket is fixed in Pynac and should doctest the issue.
Change History (15)
comment:1 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:2 Changed 7 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:3 Changed 7 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:4 Changed 5 years ago by
- Stopgaps set to incorrectAnswer
comment:5 Changed 5 years ago by
- Cc paulmasson rws added
- Milestone changed from sage-6.4 to sage-7.3
comment:6 Changed 5 years ago by
- Report Upstream changed from N/A to Reported upstream. Developers acknowledge bug.
I will fix this in Pynac by using arb.
comment:7 Changed 5 years ago by
- Report Upstream changed from Reported upstream. Developers acknowledge bug. to Fixed upstream, in a later stable release.
I will add a doctest to the Pynac upgrade ticket, so there is no more to do here.
comment:8 follow-up: ↓ 9 Changed 5 years ago by
Adding link to Pynac commit for future reference.
What is arb?
comment:9 in reply to: ↑ 8 Changed 5 years ago by
comment:10 follow-up: ↓ 11 Changed 5 years ago by
- Status changed from new to needs_info
Waiting for pynac 0.6.8
comment:11 in reply to: ↑ 10 Changed 5 years ago by
- Description modified (diff)
- Status changed from needs_info to needs_work
Replying to paulmasson:
Waiting for pynac 0.6.8
Yes Yes 8-)) I was at it all the time but had to rewrite things.
comment:12 Changed 5 years ago by
- Dependencies set to #21034
- Reviewers set to Paul Masson
comment:14 Changed 5 years ago by
comment:15 Changed 5 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Ralf, could you have a look at this issue? I noted in my review of 12521 that even after that fix there are still issues around poles of the beta function.