#6870: [with patch, needs work] Bug in binomial
------------------------------+---------------------------------------------
Reporter: hgranath | Owner: somebody
Type: defect | Status: new
Priority: minor | Milestone: sage-4.1.2
Component: basic arithmetic | Keywords: binomial
Reviewer: | Author:
Merged: |
------------------------------+---------------------------------------------
Comment(by kcrisman):
This is a good idea, and somewhat surprisingly it speeds up very small
binomials without slowing down biggish ones. However, it does seem to
slow down symbolic binomials:
Before:
{{{
sage: timeit('binomial(100,10)')
625 loops, best of 3: 21.9 µs per loop
sage: timeit('binomial(10^7,252525)')
5 loops, best of 3: 1.35 s per loop
sage: timeit('binomial(2*n,n)')
625 loops, best of 3: 60.3 µs per loop
sage: timeit('binomial(n+1,n)')
625 loops, best of 3: 78.4 µs per loop
}}}
After:
{{{
sage: timeit('binomial(100,10)')
625 loops, best of 3: 18.9 µs per loop
sage: sage: timeit('binomial(10^7,252525)')
5 loops, best of 3: 1.34 s per loop
sage: timeit('binomial(2*n,n)')
625 loops, best of 3: 76.2 µs per loop
sage: timeit('binomial(n+1,n)')
625 loops, best of 3: 137 µs per loop
}}}
I imagine that in some applications with a lot of symbolic stuff that
could be a problem, but I'm not sure. Is it possible to put a catch in
for expressions that would keep things more or less as they were there,
without making the numeric ones much slower?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6870#comment:1>
Sage <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---