# Functional differentiation

### From HaskellWiki

(Difference between revisions)

(Add another blog entry) |
(pointer to Numeric.FAD hackage code) |
||

Line 30: | Line 30: | ||

* [http://sigfpe.blogspot.com/2005/07/automatic-differentiation.html Automatic Differentiation] | * [http://sigfpe.blogspot.com/2005/07/automatic-differentiation.html Automatic Differentiation] | ||

* [http://cdsmith.wordpress.com/2007/11/29/some-playing-with-derivatives/ Some Playing with Derivatives] | * [http://cdsmith.wordpress.com/2007/11/29/some-playing-with-derivatives/ Some Playing with Derivatives] | ||

+ | |||

+ | == Code == | ||

+ | |||

+ | * [http://hackage.haskell.org/package/fad Forward accumulation mode Automatic Differentiation] Hackage package | ||

[[Category:Mathematics]] | [[Category:Mathematics]] |

## Revision as of 12:16, 27 April 2010

## Contents |

## 1 Introduction

Functional differentiation means computing or approximating the derivative of a function. There are several ways to do this:

- Approximate the derivative
*f*'(*x*) by where*h*is close to zero. (or at best the square root of the machine precision . - Compute the derivative of
*f*symbolically. This approach is particularly interesting for Haskell.

## 2 Functional analysis

If you want to explain the terms Higher order function and Currying to mathematicians, this is certainly a good example. The mathematician writes

and the Haskell programmer writes

derive :: a -> (a -> a) -> (a -> a) derive h f x = (f (x+h) - f x) / h .

derive h

*D*.

In functional analysis *D* is called a (linear) function operator, because it maps functions to functions.

derive h

*D* is in curried form. If it would be uncurried, you would write *D*(*f*,*x*).

## 3 Blog Posts

There have been several blog posts on this recently. I think we should gather the information together and make a nice wiki article on it here. For now, here are links to articles on the topic.

- Overloading Haskell numbers, part 2, Forward Automatic Differentiation.
- Non-standard analysis, automatic differentiation, Haskell, and other stories.
- Automatic Differentiation
- Some Playing with Derivatives

## 4 Code

- Forward accumulation mode Automatic Differentiation Hackage package