Comment #6 on issue 2057 by [email protected]: Units do not work together
with evalf?
http://code.google.com/p/sympy/issues/detail?id=2057
The precision of the Floats in the dictionary can be changed before each
iterative evaluation attempt. Because of automatic evaluation, substitution
of Floats into an expression before evaluation "locks in" their accuracy
and limits how accurate the evaluation can be (see gotcha document). I do
not believe this is an issue when using all Rationals since they always
retain their "infinite precision" even in an expression.
A related failure is noted here where dictionaries with complex values do
not result in a successful evaluation:
d
sin(x)**2*sin(y) + sin(y)*cos(x)**2 - sin(y)
d.n(subs={x:4,y:3+2}) # this works
.0e-137
d.n(subs={x:4,y:3+2*I}) # 2 -> 2*I give no change
sin(x)**2*sin(y) + sin(y)*cos(x)**2 - sin(y)
This is because the failure in evalf_trig to continue with an imaginary
part is not detected by the calling evalf routine and the subs never
happens in the Except part of the call (as I recall).
--
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.