Fix for bug [ 1370433 ] trigsimp(sqrt(%i2))!=sqrt(trigsimp(%i2))?
Subject: Fix for bug [ 1370433 ] trigsimp(sqrt(%i2))!=sqrt(trigsimp(%i2))?
From: Raymond Toy
Date: Mon, 13 Nov 2006 17:16:55 -0500
>>>>> "Richard" == Richard Fateman <fateman at cs.berkeley.edu> writes:
Richard> Simplification functions are supposed to change the form of an
Richard> expression, but not its value. For example,
Richard> x+x --> 2*x
Richard> radcan is supposed to be a simplification function. But it apparently
Richard> changes the value of sqrt( y^2-2*x*y-x^2).
Richard> So something is wrong.
Richard> Maybe radcan, maybe sqrt, maybe both.
I'm inclined to say radcan, since it's documented to do "unexpected"
things:
When `radexpand' is `false', certain transformations are inhibited.
`radcan (sqrt (1-x))' remains `sqrt (1-x)' and is not simplified
to `%i sqrt (x-1)'. `radcan (sqrt (x^2 - 2*x + 11))' remains
`sqrt (x^2 - 2*x + 1)' and is not simplified to `x - 1'.
radexpand defaults to true. I normally wouldn't want sqrt(x^2-2*x+1)
to become x-1, unless I know x >= 1. I'm willing to accept abs(x-1),
however.
Richard> Is this a trigsimp bug, as indicated by the subject line? I claim it
Richard> is something deeper.
Yes, you are right. It's not really a trigsimp problem, other than
trigsimp calls radcan. The issue is really with radcan, and what it
is supposed to do. My proposed fix was basically to replace radcan
with ratsimp, which really just hides the problem.
Ray