Simplifying atan2 WAS: bugs, features?



-----Robert Dodier <robert.dodier at gmail.com> wrote: -----

>Other?possibilities?--?How?about
>
>??atan2(sin(x),cos(x))?=>?if?abs(x)?<?%pi?then?x?else?atan2(sin(x),cos(x))
>
>or?maybe?just?refuse?to?simplify?unless?abs(x)?is?known?to?be?<?%pi.

Often a conditional, especially one as simple as if abs(x) < %pi ...., is
easier for *me* to understand than is a blob of floor & signum expressions.
But Maxima's simplification functions can't do simple things such as

  (if x < 1 then 42 else -42) + (if x < 1 then -42 else 42) --> 0.

And that's a problem :(

Barton