> OK. There was already a call to expand1 in the piargs code, which
> could cause it to take a long time (bug 1553866). Removing this
> call to expand causes the following test cases from rtest9a.mac to fail:
>
> declare(j,integer,e,even,o,odd);
> done$
> sin(x+(e+1/2)*%pi);
> cos(x)$
> sin(x+(o+1/2)*%pi);
> -cos(x)$
>
> Should we do that?
I think it is ok if such functionality is only coverd in some
manual simplifier like trigsimp() or trigexpand().
Actually I wouldn't mind if the core simplifier handled nothing but
the cases of constant arguments (i.e sin(0), sin(%pi/2), sin(17*%pi/2), ...)
but I guess Robert and Stavros will disagree ...
On a side note:
Maxima has lots of different code to handle integer stuff
(the simplifieres for %piargs and floor, featurep(..., integer),
rectform, and perhaps other stuff I have missed) all of which were
written at different times by different people and thus have rather
different capabilities. I once tried to specify how a general
function for interger handling could look like, but got side tracked
before I could come to an end. Perhaps I should work on that again.
Perhaps somebody else is faster... :)
Harald