simplification of atan2



>
> > (%i1) atan2(x,x);
> > Is  x   positive or negative? pos;
> Should it also ask if x is zero?


In general, Maxima doesn't ask about isolated singularities.  Otherwise, it
wouldn't simplify x/x => 1.  (There is a good argument for tagging the 1
with "assuming that x#0, but of course we don't do that.) Of course, you
could argue that the atan2 case is different since it is not continuous at
(0,0), but if you restrict its domain to (pos,pos) or (neg,neg), it is
continuous in each of those cases.

Annoyingly, though, atan2(abs(x),abs(x)) *does* ask whether x is zero or
non-zero, though atan2(x^2,x^2) does not.  Bizarrely, if you answer that
x=0, it doesn't give the error that atan2(0,0) does, but blithely gives
pi/4. And if atan2(x,x) asks a question to simplify, why doesn't
atan2(x,2*x)?

> Regardless of your opinion about asksign in general, it seems
> > wrong for a simplification function to use asksign.


Yes, I generally agree.  After all, abs(x) doesn't ask for the sign of x.

We could
> > change atan2 to use atan2(x,x) = (%pi/4) * (2 * signum(x) - 1).
> > This is wrong for x = 0, x = %i, ... Suggestions?


Mathematically OK, I guess, but probably not very useful.

              -s