differentiation. Reply

Alec alec314159@yahoo.com
Wed, 9 Jan 2002 10:59:33 -0500


On Wednesday 09 January 2002 06:50 am, S.D.Mechveliani wrote:
> Zhe Fu <fuzhezheng@hotmail.com>  writes
>
> > Is there any built-in functions in Haskell to implement
> > diffential operation and partial diffential operation?
> > Or can anyone give me some advices about how to implement them
> > with Haskell? Thanks.
>
> There are no differential operators in Haskell-98 standard library,
> nor even polynomial arithmetic.
> Very probably, there exist application programs treating
> differential operators. Try to search in  http://www.haskell.org
>
> If you are going to implement differential operators,
> try first to implement, for example, polynomial multiplication.
> After this, differentiation would not look hard.
> But it depends on what one wants to differentiate, one has to
> formulate first what kind of expressions are supposed to be
> differentiated.
>

how about this:

diff f x = (f (x + epsilon) - f (x - epsilon)) / (2 * epsilon) 
   where epsilon = 0.00001

every call to say "diff sin" will cost you about as much as every call to 
"sin"

HTH

Alec