Simplifying atan2 WAS: bugs, features?



>From a programming point of view an identity is okay but changing
atan2(sin(x),cos(x)) to x would make programming any kind of new trig
function a nightmare.  I assume you are just considering this for the
command line.
Rich


On Tue, Jul 28, 2009 at 1:25 PM, Robert Dodier <robert.dodier at gmail.com>wrote:

> On Mon, Jul 27, 2009 at 10:07 PM, Barton Willis<willisb at unk.edu> wrote:
>
> > For real x, atan2(sin(x),cos(x)) = %pi - mod(%pi - x, 2 * %pi) is an
> > identity.
> > But %pi - mod(%pi - x, 2 * %pi) can be a mess too.
>
> Maybe that kind of mess is OK if it has to be evoked by an
> explicit function call (not part of the automatic simplification).
>
> 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.
>
> FWIW
>
> Robert
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>