Hi!
I calculated a Taylor Series expansion using SymPy. I want to evaluate this expansion at a lot of points. Now, the expansion (specifcally the derivatives at the development point) contain sin(x),cos(x) x and powers thereof. Hence, I made a substitution subs(sin(x),a) and subs(cos(x),b), where a and b are just real symbols. Then I call T*(x,sin(x),cos(x)) instead of T(x), where T is the Taylor expansion, which gives a huge boost and speed, because the sin and cos terms are not always re-evaluated.
Do you know other such hacks? For example, clever use of collect() should be pretty helpful in many cases.
Cheers,
Wolfgang