#6870: [with second patch, needs review] 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 hgranath):
I think to some extent this is a correctness vs speed issue. Before
the patch there is an asymmetry in the checking of whether m and x-m
is in ZZ. So e.g. binomial(3/2,1/2) works while binomial(3/2,1/1)
fails, although the documentation indicates they should be equivalent.
For me it was very confusing when something like that happened.
The benchmark case binomial(n+1,n) benefits from this asymmetry. I
have thought about it, but so far I have not found a satisfactory
solution which will not affect the speed of binomial(n+1,n) while
doing the right thing in other cases.
The other thing my patch is doing is to check more carefully if x is
an integer. As noted this will be an improvement when this succeeds.
Apart from the above benchmarks, try e.g. binomial(QQ(10**7),252525) or
binomial(SR(10**7),252525) with and without the patch applied. This
part of the patch however is not as important to me, a user could
always use binomial(ZZ(x),m) when beneficial. Hence an alternative
patch is to just do the first part. This will decrease the speed
regression in the symbolic case.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6870#comment:2>
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
-~----------~----~----~----~------~----~------~--~---