In this difference, the right term is not simplified
>>> b - (-x + 1/x)/(x*(x - 1/x)**2)
b - (-x + 1/x)/(x*(x - 1/x)**2)
Here, it is treated like a negated term (not a subtracted term) and
the result is different
>>> - (-x + 1/x)/(x*(x - 1/x)**2)
1/(x*(x - 1/x))
This allows rref to generate huge expressions which (if the
subtraction were handled as the addition of a negated term) would
otherwise be much simpler.
Consider `r[0][8, 16]` of the following:
m = Matrix([[ 0, -1, 0, 0, 0, 0, -1, 0,
0],
[-1, x, -1, 0, 0, 0, 0, -1, 0],
[ 0, -1, x, 0, 0, 0, 0, 0, -1],
[ 0, 0, 0, x, -1, 0, -1, 0, 0],
[ 0, 0, 0, -1, x, -1, 0, -1, 0],
[ 0, 0, 0, 0, -1, 0, 0, 0, -1],
[-1, 0, 0, -1, 0, 0, x, -1, 0],
[ 0, -1, 0, 0, -1, 0, -1, 0, -1],
[ 0, 0, -1, 0, 0, -1, 0, -1, x]])
r=m.row_join(eye(9)).rref()
Here's the value of `r[0][8,16]`:
-(-(-x + 1/x)/(x - 1/x) - (-(-x + 1/x)/(x*(x - 1/x)**2) - 1/(x*(x
-
1/x)))*(-(-x + 1/x)/(x*(x - 1/x)) + 1/x)/(2*x - 2/x - (-x +
1/x)/(x**2*(x - 1/x)**2) - 1/(x**2*(x - 1/x))) - 1)/((-(-x + 1/x)/
(x -
1/x)**2 - (-(-x + 1/x)/(x*(x - 1/x)**2) - 1/(x*(x - 1/x)))**2/(2*x
-
2/x - (-x + 1/x)/(x**2*(x - 1/x)**2) - 1/(x**2*(x - 1/x))) - 1/(x
-
1/x))*(2*x + 2*(-(-x + 1/x)/(x*(x - 1/x)**2) - 1/(x*(x - 1/x)))*(-
(-x
+ 1/x)/(x - 1/x) - (-(-x + 1/x)/(x*(x - 1/x)**2) - 1/(x*(x -
1/x)))*(-(-x + 1/x)/(x*(x - 1/x)) + 1/x)/(2*x - 2/x - (-x +
1/x)/(x**2*(x - 1/x)**2) - 1/(x**2*(x - 1/x))) - 1)/(x*(-(-x + 1/
x)/(x
- 1/x)**2 - (-(-x + 1/x)/(x*(x - 1/x)**2) - 1/(x*(x - 1/x)))**2/
(2*x -
2/x - (-x + 1/x)/(x**2*(x - 1/x)**2) - 1/(x**2*(x - 1/x))) - 1/(x
-
1/x))*(2*x - 2/x - (-x + 1/x)/(x**2*(x - 1/x)**2) - 1/(x**2*(x -
1/x)))) - 2*(-(-x + 1/x)/(x*(x - 1/x)) + 1/x)/(x*(2*x - 2/x - (-x
+
1/x)/(x**2*(x - 1/x)**2) - 1/(x**2*(x - 1/x)))) - 2/x))
It's just a fancy nan:
>>> cse(r[0][8, 16])
([], [nan])
/c
--
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.