Updates:
Labels: -Priority-Medium Priority-High
Comment #2 on issue 3038 by smi...@gmail.com: sign change in evalf of
complex value as precision is increased
http://code.google.com/p/sympy/issues/detail?id=3038
Here is another symptom, perhaps.
Substitution of two forms of an expression into another expression give
very different results upon evalf'ing. (The value of the expression (v)
and the simplified version (vcse) are given at the end of this discussion.)
>>> f = 5*sqrt(x) + 5*sqrt(-x + 1) + 5*sqrt(x + 1) - 6*sqrt(5)
>>> r, vcse = cse(v);vcse=vcse[0].subs(reversed(r))
>>> v.n()
0.655814631227503 - 0.e-22*I
>>> vcse.n()
0.655814631227503
So v and vcse evaluate to the same value but after substitution:
>>> f.subs(x,v).n(chop=True)
0
>>> f.subs(x,vcse).n(chop=True)
-8.09823827278194
Substituting into a simpler expression suggests that problem might be in
evalf_pow:
>>> sqrt(x).subs(x,v).n(chop=True)
0.809823827278194
>>> sqrt(x).subs(x,vcse).n(chop=True)
-0.809823827278194
Here are the values of v and vcse:
>>> from sympy.utilities.misc import filldedent
>>> print filldedent(str(v))
-1484/375 - (-2 + 2*sqrt(3)*I)*(-12459439/52734375 +
114*sqrt(12657)/78125)**(1/3) - 172564/((-140625/2 +
140625*sqrt(3)*I/2)*(-12459439/52734375 +
114*sqrt(12657)/78125)**(1/3))
>>> print filldedent(str(vcse))
-2*(278250*(1 - sqrt(3)*I)*(-114*sqrt(12657)/78125 +
12459439/52734375)**(1/3) - 140625*(-1)**(1/3)*(1 -
sqrt(3)*I)**2*(-114*sqrt(12657)/78125 + 12459439/52734375)**(2/3) +
172564*(-1)**(2/3))/(375*(1 - sqrt(3)*I)*(-76950*sqrt(12657) +
12459439)**(1/3))
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.