Hi,
  now taylor can do expansions around a point different from zero.
  It should run anything series runs (at worst calling series)

  Here are a few examples at precision <= 11
  which taylor does in a fraction of a second and
  series either takes more than 20 minutes and more than 3GB of
memory,
  or gives error.


examples on QQ:
>>> from sympy import *
>>> from sympy.polys.ltaylor import *
>>> from time import time as tm
>>> x,y = symbols('x,y')
>>> p=x
>>> for i in range(20):
...  p = sin(p)

>>> t0=tm();p1=taylor(p,x,0,10);'%.2f'%(tm()-t0)
'0.03'
>>> p1
x - 10*x**3/3 + 16*x**5 - 5287*x**7/63 + 4114*x**9/9 + O(x**10)

>>> t0=tm();p2=series(p,x,0,10);'%.2f'%(tm()-t0)
stopped after 21min, 3GB used

Sage' taylor takes 1.2s

>>> p = 1
>>> for n in range(10):
...   p *= (1 + sin(n*sin(x))**2)**(-Rational(1,n))
...
>>> t0=tm();taylor(p,x,0,10);'%.2f'%(tm()-t0)
1 - 45*x**2 + 2715*x**4 - 178847*x**6 + 90261796*x**8/7 + O(x**10)
'0.03'

>>> t0=tm();series(p,x,0,10);'%.2f'%(tm()-t0)
stopped after 29min, 4GB used


example with polynomial parameter on QQ
>>> p = 1/sqrt(1 + y*sin(x)**2)
>>> t0=tm();p1=taylor(p,x,0,11,pol_pars=[y]);'%.3f'%(tm()-t0)
'0.028'
>>> p1
1 - 17*x**10*y**2/1260 - y*x**2/2 - x**6*y**2/4 + 3*x**4*y**2/8 +
3*x**8*y**2/40 - 7*x**10*y**3/48 - 5*x**6*y**3/16 + 5*x**8*y**3/16 -
35*x**10*y**4/96 + y*x**4/6 + 35*x**8*y**4/128 - 63*x**10*y**5/256 -
y*x**6/45 + y*x**8/630 - y*x**10/14175 + O(x**11)

>>> t0=tm();p1=series(p,x,0,11);'%.3f'%(tm()-t0)
....
AssertionError

Sage's taylor takes 0.14s

examples on SR:
>>> p = 1
>>> for n in range(1,4):
...   p *= (1 + pi*sin(n*sin(x))**2)**(-Rational(1,n))
...
>>> t0=tm();p1=taylor(p,x,0,10);'%.2f'%(tm()-t0)
'0.24'

series gives AssertionError

Sage's taylor takes 0.14s

>>> p = 1/sqrt(1 + exp(y)*sin(x)**2)
>>> t0=tm();p1=taylor(p,x,0,11);'%.3f'%(tm()-t0)
'0.213'

series gives AssertionError

Sage's taylor takes 0.15s

I have posted today about issue 1038 on series, in which taylor goes
well.

I will make soon a pull request, if I find out how to do it :)

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.

Reply via email to