#12448: The binomial implementation does a quotient of gamma values, which is
wrong
------------------------------------+---------------------------------------
Reporter: Snark | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-5.7
Component: basic arithmetic | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
------------------------------------+---------------------------------------
Changes (by ppurka):
* status: needs_work => needs_review
* milestone: => sage-5.7
Old description:
> There are special formulas to apply for quotients of gamma values, since
> those quotients can be pretty reasonable even though the numerator and
> denominator are too big, for example:
> {{{
> sage: binomial(float(1000),float(1001))
> nan
> sage: binomial(1000,1001)
> 0
> }}}
> and:
> {{{
> sage: binomial(float(1001),float(1000))
> nan
> sage: binomial(1001,1000)
> 1001
> }}}
New description:
There are special formulas to apply for quotients of gamma values, since
those quotients can be pretty reasonable even though the numerator and
denominator are too big, for example:
{{{
sage: binomial(float(1000),float(1001))
nan
sage: binomial(1000,1001)
0
}}}
and:
{{{
sage: binomial(float(1001),float(1000))
nan
sage: binomial(1001,1000)
1001
}}}
----
Apply to sage/devel
1. [attachment:trac_12448-fix_binomial.patch]
--
Comment:
[attachment:trac_12448-fix_binomial.patch Added a patch] which uses pari
now, as was indicated as a future fix in a comment. This speeds up all the
floating point binomials by about a factor of 5, and fixes the nan that
was being returned from large floats. Needs review now :)
Patchbot apply trac_12448-fix_binomial.patch
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12448#comment:6>
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 http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.