[ bsd3, library, math ] [ Propose Tags ]

Forward Automatic Differentiation via overloading to perform nonstandard interpretation that replaces original numeric type with corresponding generalized dual number type. Existential type "branding" is used to prevent perturbation confusion. **Note: In general we recommend using the ad package maintained by Edward Kmett instead of this package.**

Versions [faq] 1.0, 1.1.0.1 base (<5) [details] BSD-3-Clause Barak A. Pearlmutter and Jeffrey Mark Siskind 2008-2009 Barak A. Pearlmutter and Jeffrey Mark Siskind bjorn.buckwalter@gmail.com Math http://github.com/bjornbm/fad by BjornBuckwalter at Sat Dec 22 17:26:31 UTC 2012 NixOS:1.1.0.1 1129 total (4 in the last 30 days) (no votes yet) [estimated by rule of succession] λ λ λ Docs uploaded by userBuild status unknown

## Modules

[Index]

#### Maintainer's Corner

For package maintainers and hackage trustees

[back to package description]
   Copyright  : 2008-2009, Barak A. Pearlmutter and Jeffrey Mark Siskind

Maintainer : bjorn.buckwalter@gmail.com
Stability  : experimental
Portability: GHC only?

nonstandard interpretation that replaces original numeric type with
corresponding generalized dual number type.

Each invocation of the differentiation function introduces a
distinct perturbation, which requires a distinct dual number type.
In order to prevent these from being confused, tagging, called
branding in the Haskell community, is used.  This seems to prevent
perturbation confusion, although it would be nice to have an actual
proof of this.  The technique does require adding invocations of
lift at appropriate places when nesting is present.

employed in this library see:
<http://www.bcl.hamilton.ie/~barak/papers/ifl2005.pdf>

Installation
============
To install:
cabal install

Or:

Examples
========
Define an example function 'f':

> f x = 6 - 5 * x + x ^ 2  -- Our example function

Basic usage of the differentiation operator:

> y   = f 2              -- f(2) = 0
> y'  = diff f 2         -- First derivative f'(2) = -1
> y'' = diff (diff f) 2  -- Second derivative f''(2) = 2

List of derivatives:

> ys = take 3 \$ diffs f 2  -- [0, -1, 2]

Example optimization method; find a zero using Newton's method:

> y_newton1 = zeroNewton f 0   -- converges to first zero at 2.0.
> y_newton2 = zeroNewton f 10  -- converges to second zero at 3.0.

Credits
=======
Barak A. Pearlmutter <barak@cs.nuim.ie> &
Jeffrey Mark Siskind <qobi@purdue.edu>

Work started as stripped-down version of higher-order tower code