Simplifying atan2 WAS: bugs, features?



"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."
Agreed.

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

Why not extend the logic for (the undocumented) %if and use it.

%if(x<1, 42, -42)+%if(x<1,-42,42) should give zero but it doesn't.  I would
not complain if it did since this is not a program "flow of control"
statement.

Rich



On Tue, Jul 28, 2009 at 9:01 PM, Barton Willis <willisb at unk.edu> wrote:

> -----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
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>