On Fri, Nov 12, 2004 at 11:00:12AM -0600, Barton Willis wrote:
> Here is a proposed mechanism for deciding when
> to apply even / odd function simplification
> rules.
>
> Notes
>
> (1) My code does not use the sign of the
> argument to decide when to use even / odd
> function simplification.
>
> (2) I thank Raymond for finding bug in my
> first proposal.
>
> (3) I changed all the trig simplifying
> functions in trigi (but not the functions
> in trigo). The test suite shows no errors with
> my code. Timing mminusp*, try-even-fun-simp,
> and try-odd-fun-simp shows mminusp* is slightly
> slower.
>
> (4) Examples (these are no different from
> the way maxima currently works, I think).
>
> (%i1) sin(x*y) + sin(-x*y);
> (%o1) 0
> (%i2) sin(u+n-k) + sin(k-u-n);
> (%o2) 0
>
> This one needs to be expanded to crunch to zero
> (%i3) sin(u * (n-k)) + sin(u * (k-n));
> (%o3) SIN((n - K) U) + SIN((K - n) U)
> (%i4) expand(%);
> (%o4) 0
>
> It's possible to change neg so that this simplifies to zero
> without expansion. But ...
>
Now I see that things are more complicated than in the case of SIN(-x)=-SIN(x).
My more then 1 year experience with Maxima suggests that it is always necessary
to play with expand, ratsimp, and so on in order to get a desired
simplification.
Therefore, in the above rule, it is OK if it requires to apply expand().
--
Alexander