#15196: Use mpmath for numerical evaluation of the beta function
-------------------------------------------------+-------------------------
       Reporter:  eviatarbach                    |        Owner:
           Type:  defect                         |       Status:
                                                 |  needs_work
       Priority:  major                          |    Milestone:  sage-7.3
      Component:  numerical                      |   Resolution:
       Keywords:                                 |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  Fixed upstream, in a later     |  Work issues:
  stable release.                                |
         Branch:                                 |       Commit:
   Dependencies:                                 |     Stopgaps:
                                                 |  incorrectAnswer
-------------------------------------------------+-------------------------
Changes (by rws):

 * status:  needs_info => needs_work


Old description:

> 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.

New description:

 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.

--

Comment:

 Replying to [comment:10 paulmasson]:
 > Waiting for pynac 0.6.8

 Yes Yes 8-)) I was at it all the time but had to rewrite things.

--
Ticket URL: <https://trac.sagemath.org/ticket/15196#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to