The AST stuff may be interesting and amusing, however before any
actual benchmarking it seems like overly complicated solution.

.evalf() is slow not because it traverses the expression tree (any
evaluation method would do this, closures would not make less function
calls which is the expensive part), but because it uses very
complicated logic to ensure precision. A simple flag "use numpy/python
math/whatever" that uses for instance methods called '_evalf_numpy'
and '_evalf_cmath' would be **way** simpler and presumably just as
fast.

And you will not need to cater specifically to cases where only half
of the expression can be translated (special functions), you just
default to multiprecision evalf() and throw away the high precision
part.

-- 
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