Hi!
I think I've fixed bug 580721. Currently, simp-%tan and simp-%cot look
at form and one of the attempted simplifications is that if form is
tan(u) or cot(u) where u is linear in %pi (as measured by linearp), it
calls %piargs-tan/cot.
%piargs-tan/cot is able to strip out constant multiples of %pi from tan,
so for example it knows that tan(x+%pi/2) = -cot(x).
--
However, when you gave it tan(%pi*x+%pi/2) for example, the "linear
coeff" of %pi is x+1/2, and it can't do anything useful. Furthermore,
the simplification routine then calls tan(%pi/2), causing a division by
zero error.
--
My proposed change looks for constant multiples of %pi, rather than
linear multiples, so from %pi*x+%pi/2 it gets %pi/2, which it can
successfully get rid of. After the patch, the testsuite still works
fine. I've attached a patch which defines the functions and have the
following questions:
1) The code wasn't documented at all: does anyone know if I'm right
about what everything does?
2) I never did quite work out what one of the tests in %piargs-tan/cot
actually did: there's a comment beginning I _think_ on line 593. Anyone
know?
3) I defined some utility functions, specifically filter-sum,
constant-linear-p and has-constant-linear-term. Do any of them already
exist in maxima and I just didn't find them? If not, where should they
go? In particular filter-sum looks like it might be more generally
applicable.
4) If this patch is good, should I also write a test in the test_suite?
Hope this is of interest!
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trigi.lisp.diff
Type: text/x-patch
Size: 7070 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20071228/1f85b03e/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20071228/1f85b03e/attachment-0001.pgp