Barton Willis wrote:
> The atan2 simplification function sometimes asks questions:
>
> (%i1) atan2(x,x);
> Is x positive or negative? pos;
> (%o1) %pi/4
>
>
Should it also ask if x is zero?
> Regardless of your opinion about asksign in general, it seems
> wrong for a simplification function to use asksign. We could
> change atan2 to use atan2(x,x) = (%pi/4) * (2 * signum(x) - 1).
> This is wrong for x = 0, x = %i, ... Suggestions?
>
Isn't atan2 really only defined if x and y are real?
> Also
>
> (%i1) atan2(sqrt(x-1),x);
> (%o1) atan(sqrt(x-1)/x) <-- atan not atan2
>
>
This seems right to me, if we assume sqrt(x-1) and x are both real.
then sqrt(x-1) being real implies x > 1, so we're always in the first
quadrant. I suspect, however, that maxima isn't that smart and the
conversion to atan is coincidental.
> (%i2) atan2(sqrt(x),x);
> (%o2) atan2(sqrt(x),x) <-- this time atan2
>
>
That doesn't seem right.
Ray