Comment #20 on issue 1038 by [email protected]: (sin(x)*cos(x)).series(x, 0, 1000) takes forever
http://code.google.com/p/sympy/issues/detail?id=1038

Hi,
 with taylor in http:github.com/pernici/sympy this issue can be solved.
 taylor can be used as series
from sympy import *
from sympy.polys.ltaylor import taylor
x = Symbol('x')
taylor(sin(x),x,0,10)
x - x**3/6 + x**5/120 - x**7/5040 + x**9/362880 + O(x**10)
Below are benchmarks for this problem and variations

for each precision the taylor expansions of these functions are benchmarked
sin(x)
cos(x)*sin(x)
cos(x + x**2)*sin(x - 2*x**2)
cos(x)*sin(x)*cos(2*x)*sin(2*x)
cos(sin(x))*sin(sin(x))

on Intel Core2 Quad  Q8200 2.33GHz
times in seconds
on Intel Core2 Quad  Q8200 2.33GHz
times in seconds
prec     series    taylor
10       0.026     0.018
         0.10      0.019
         0.30      0.04
         0.20      0.02
         3.4       0.02

100      0.23      0.18
         1.7       0.19
         19        0.46
         4.8       0.21
                   0.35

200      0.47      0.36
         7.9       0.4
         167       1.4
         32        0.53
                   1.6

300      0.7       0.5
         28        0.7
                   3.4
                   1.0
                   5.0

400      0.9       0.7
         81        1.0
                   6.8
                   1.8
                   12

1000               1.9
                   5.4
                   98
                   18
                   242

Mario




--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to