> In fact, if sympy uses Fraction by default as backend for rationals, I
> must correct
> the comparison between rmpoly and sympy:
> it is 47x slower, not 3 orders of magnitude as claimed before.
> If so, I apologize for the mistake; I am not much familiar with sympy.
>
> >>> from rmpoly import *
> >>> from fractions import Fraction
> >>> rp,x = rgens('x',10,Fraction)
> >>> h=100
> >>> from time import time
> >>> t0=time();p = x.cos('x',h).pow_trunc(-1,'x',h); '%.2f'%(time()-t0)
>
> '1.04'
Ok, I saw that sympy uses its own Rational class; using it
>>> rp,x = rgens('x',10,Rational)
the timing is the same as with Fraction; repeating the computation
with Rational it
takes 1/10 of the time, I guess that it uses caching.
Why does not sympy use gmpy.mpq by default if available?
Mario
--
You received this message because you are subscribed to the Google Groups
"sympy" 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/sympy?hl=en.