3 from timeit
import default_timer
as clock
4 from random
import randint
6 from sympy
import Symbol
, Add
, Mul
7 print 'I: Running SymPy'
9 from sympycore
import Symbol
10 print 'I: Running sympycore'
18 "e=(x+y+z+1)**10;f=e*(e+1);f.expand()"
24 "e=(x+y+z+1)**10; f=e**2+e; f.expand()"
30 "e=(x+y+z+1)**20; f=e**2+e; f.expand()"
36 "e=(x+y+z+1)**30; f=e**2+e; f.expand()"
42 "e=(x+y+z+1)**40; f=e**2+e; f.expand()"
48 "e=(x+y+z+1)**10; e.expand()"
53 "e=(x+y+z+1)**50; e.expand()"
58 "e=(x+z+y)**20 * (z+x)**9; e.expand()"
59 e
= (x
+z
+y
)**20 * (z
+x
)**9
63 "e=((x**x+y**y+z**z)**10 * (x**y+y**z+z**x)**10); e.expand()"
64 e
= ((x
**x
+y
**y
+z
**z
)**10 * (x
**y
+y
**z
+z
**x
)**10)
68 "Add(x,<random integer>,y), 2000x"
72 Add((x
, randint(0, 1000000), y
))
75 "Mul(x,<random integer>,y), 2000x"
79 Mul((x
, randint(0, 1000000), y
))
82 "sum(x**i/i,i=1..400)"
90 "sum(x**i/i,i=1..400), using Add(terms)"
120 print "%65s: %f" % (b
.__doc
__, t
)