Complex rationals: Though simp_mode(%t), r+(-r) and r-r don't simplify the denominator to 1. Fix attached.
@sgougeon)
Reported by Samuel GOUGEON (%r_as_14429.zip (2.01 KB, application/zip)
%r_a_r() fixed. %r_s_r() simplified(!) and fixed.
BUG DESCRIPTION:
----------------
--> simp_mode(%t)
--> r = 1/(%i-%z)^3
r =
1
-------------------
2 3
-i + 3z + i*3z - z
--> r-r
ans =
0
-----------------------------------------
2 3 4 5 6
-1 - i*6z + 15z + i*20z - 15z - i*6z + z <<== should be simplified into: 1
--> r+(-r)
ans =
0
-----------------------------------------
2 3 4 5 6
-1 - i*6z + 15z + i*20z - 15z - i*6z + z <<== should be simplified into: 1
WITH THE PATCH:
---------------
--> r-r
ans =
0
--
1
--> r+(-r)
ans =
0
--
1
Can't do simpler :)
ERROR LOG:
----------
None. Missing simplification leading to huge unrelevant calculations.
HOW TO REPRODUCE THE BUG:
-------------------------
simp_mode(%t)
r = 1/(%i-%z)^3
s = r-r
s.den ==1
a = r+(-r)
a.den ==1
OTHER INFORMATION:
------------------
This report comes from the initial report posted as bug 13893, splitting it for more clarity.