Fix bug #3956: expand(1/((sqrt(2)-1)*(sqrt(2)+1))) => 1/1 (unsimplified)
This is an ancient bug that was present in Macsyma.
EXPANDTIMES has been constructing MEXPT expressions marked with
the SIMP flag when there is no reason to assume the expressions
are actually simplified. The expression is of the form
((MEXPT SIMP) E -1) where E is the result of EXPANDTERMS.
(%i1) expand(1/((sqrt(2)-1)*(sqrt(2)+1)));
(%o1) 1/1
(%i2) expand(%);
(%o2) 1
(%i3) expand(1/(-(sqrt(n+1)-1)*(sqrt(n+1)+1)));
(%o3) 1/(-n)
(%i4) expand(%);
(%o4) -1/n
Now we just use INV instead of manually constructing the MEXPT
expressions with bogus SIMP flags.
See also commit
eb4bfa5f regarding the similar bug #3934.
No problems with the test suite or share test suite. New tests
have been added to rtest16.