Status: Accepted
Owner: smichr
Labels: Type-Defect Priority-Medium WrongResult
New issue 2105 by smichr: n(1) give wrong result sometimes
http://code.google.com/p/sympy/issues/detail?id=2105
The evaluation of the following expression to 1 digit of precisision gives
the wrong result:
v=S('-(357587765856 + 18873261792*249**(1/2) + 56619785376*I*83**(1/2)
+ 108755765856*I*3**(1/2) + 41281887168*6**(1/3)*(1422 +
54*249**(1/2))**(1/3) - 1239810624*6**(1/3)*249**(1/2)*(1422 +
54*249**(1/2))**(1/3) - 3110400000*I*6**(1/3)*83**(1/2)*(1422 +
54*249**(1/2))**(1/3) + 13478400000*I*3**(1/2)*6**(1/3)*(1422 +
54*249**(1/2))**(1/3) + 1274950152*6**(2/3)*(1422 +
54*249**(1/2))**(2/3) + 32347944*6**(2/3)*249**(1/2)*(1422 +
54*249**(1/2))**(2/3) - 1758790152*I*3**(1/2)*6**(2/3)*(1422 +
54*249**(1/2))**(2/3) - 304403832*I*6**(2/3)*83**(1/2)*(1422 +
54*249**(1/2))**(2/3))/(175732658352 + (1106028 + 25596*249**(1/2) +
76788*I*83**(1/2))**2)')
v.n(1)
2.0e+9 - 3.0e+8*I
If you take the primitive of it and combine the two, the right result is
obtained:
primitive(v)
(216, -1655498916/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) -
87376212*249**(1/2)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) -
503498916*I*3**(1/2)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) -
262128636*I*83**(1/2)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) -
191119848*6**(1/3)*(1422 + 54*249**(1/2))**(1/3)/(1072763297568 +
56619785376*249**(1/2) + 169859356128*I*83**(1/2) +
326267297568*I*3**(1/2)) - 5902547*6**(2/3)*(1422 +
54*249**(1/2))**(2/3)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) -
149759*6**(2/3)*249**(1/2)*(1422 + 54*249**(1/2))**(2/3)/(1072763297568 +
56619785376*249**(1/2) + 169859356128*I*83**(1/2) +
326267297568*I*3**(1/2)) + 5739864*6**(1/3)*249**(1/2)*(1422 +
54*249**(1/2))**(1/3)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) -
62400000*I*3**(1/2)*6**(1/3)*(1422 + 54*249**(1/2))**(1/3)/(1072763297568 +
56619785376*249**(1/2) + 169859356128*I*83**(1/2) +
326267297568*I*3**(1/2)) + 1409277*I*6**(2/3)*83**(1/2)*(1422 +
54*249**(1/2))**(2/3)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)) +
8142547*I*3**(1/2)*6**(2/3)*(1422 + 54*249**(1/2))**(2/3)/(1072763297568 +
56619785376*249**(1/2) + 169859356128*I*83**(1/2) +
326267297568*I*3**(1/2)) + 14400000*I*6**(1/3)*83**(1/2)*(1422 +
54*249**(1/2))**(1/3)/(1072763297568 + 56619785376*249**(1/2) +
169859356128*I*83**(1/2) + 326267297568*I*3**(1/2)))
_[0]*_[1].n(1)
0.2 + 1.0*I
This matches with the evaluation to 2 digits:
v.n(2)
0.18 + 1.2*I
--
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.