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

Status badges

Description (last modified by rws)

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 vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:2 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:3 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:4 Changed 5 years ago by jakobkroeker

  • Stopgaps set to incorrectAnswer

comment:5 Changed 5 years ago by paulmasson

  • Cc paulmasson rws added
  • Milestone changed from sage-6.4 to sage-7.3

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.

comment:6 Changed 5 years ago by rws

  • 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 rws

  • 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: Changed 5 years ago by paulmasson

Adding link to Pynac commit for future reference.

What is arb?

comment:10 follow-up: Changed 5 years ago by paulmasson

  • Status changed from new to needs_info

Waiting for pynac 0.6.8

comment:11 in reply to: ↑ 10 Changed 5 years ago by rws

  • 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 paulmasson

  • Dependencies set to #21034
  • Reviewers set to Paul Masson

comment:13 Changed 5 years ago by paulmasson

  • Authors set to Ralf Stephen
  • Status changed from needs_work to positive_review

Fixed in #21034

comment:14 Changed 5 years ago by paulmasson

  • Authors changed from Ralf Stephen to Ralf Stephan

comment:15 Changed 5 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.