sdiff, differentiating expressions



Am Donnerstag, den 14.05.2009, 15:28 -0700 schrieb Richard Fateman:
> the program sdiff,  in the source file comm.lisp
> has gotten corroded over the last few years by patches put in (probably) 
> the wrong places.
> 
> I rewrote it in the file 
> http://www.cs.berkeley.edu/~fateman/lisp/new-sdiff.lisp and moved the 
> patches off to property lists.
> 
> If you have modified sdiff, please check it out.
> 
> How corroded??
> 
>   well, the program  sdiff goes through a sequential list of things that 
> it knows how to differentiate, like
> plus, times, "rational functions", some other things,  and then a big 
> multi-way branch to do sin,cos,exp,...
> 
> 
> Now over the years people have put into "some other things" all kinds of 
> rare and unusually occurring things.
> Like hypergeometric functions, laplace transforms, etc etc.
> 
> These patches should come AFTER sin/cos/exp,  or at the same time as 
> sin/cos/exp , or if for some reason
> they must have some special checks because of peculiar arguments, they 
> can be done by a multi-way branch.
> 
> See the file for how it can be done.
> 
> what do you think?
> 
> I have not tried timing tests.

I think it is a good idea to improve sdiff this way. 

One point to look at are the derivatives of realpart and imagpart. In a
mail to the bug report "diff(realpart) bogus - ID: 938134" I have
suggested to cut out the derivatives of these functions.

What do you think? Should I commit the new sdiff routine and cut out the
derivatives of realpart and imagpart?

Dieter Kaiser