Copyright | (c) Edward Kmett 2010-2015 |
---|---|

License | BSD3 |

Maintainer | ekmett@gmail.com |

Stability | experimental |

Portability | GHC only |

Safe Haskell | None |

Language | Haskell2010 |

Higher order derivatives via a "dual number tower".

- data AD s a
- data Tower a
- auto :: Mode t => Scalar t -> t
- taylor :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> a -> [a]
- taylor0 :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> a -> [a]
- maclaurin :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a]
- maclaurin0 :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a]
- diff :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> a
- diff' :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> (a, a)
- diffs :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a]
- diffs0 :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a]
- diffsF :: (Functor f, Num a) => (forall s. AD s (Tower a) -> f (AD s (Tower a))) -> a -> f [a]
- diffs0F :: (Functor f, Num a) => (forall s. AD s (Tower a) -> f (AD s (Tower a))) -> a -> f [a]
- du :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f (a, a) -> a
- du' :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f (a, a) -> (a, a)
- dus :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f [a] -> [a]
- dus0 :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f [a] -> [a]
- duF :: (Functor f, Functor g, Num a) => (forall s. f (AD s (Tower a)) -> g (AD s (Tower a))) -> f (a, a) -> g a
- duF' :: (Functor f, Functor g, Num a) => (forall s. f (AD s (Tower a)) -> g (AD s (Tower a))) -> f (a, a) -> g (a, a)
- dusF :: (Functor f, Functor g, Num a) => (forall s. f (AD s (Tower a)) -> g (AD s (Tower a))) -> f [a] -> g [a]
- dus0F :: (Functor f, Functor g, Num a) => (forall s. f (AD s (Tower a)) -> g (AD s (Tower a))) -> f [a] -> g [a]

# Documentation

Bounded a => Bounded (AD s a) | |

Enum a => Enum (AD s a) | |

Eq a => Eq (AD s a) | |

Floating a => Floating (AD s a) | |

Fractional a => Fractional (AD s a) | |

Num a => Num (AD s a) | |

Ord a => Ord (AD s a) | |

Read a => Read (AD s a) | |

Real a => Real (AD s a) | |

RealFloat a => RealFloat (AD s a) | |

RealFrac a => RealFrac (AD s a) | |

Show a => Show (AD s a) | |

Erf a => Erf (AD s a) | |

InvErf a => InvErf (AD s a) | |

Mode a => Mode (AD s a) | |

Typeable (* -> * -> *) AD | |

type Scalar (AD s a) = Scalar a |

`Tower`

is an AD `Mode`

that calculates a tangent tower by forward AD, and provides fast `diffsUU`

, `diffsUF`

(Num a, Bounded a) => Bounded (Tower a) | |

(Num a, Enum a) => Enum (Tower a) | |

(Num a, Eq a) => Eq (Tower a) | |

Floating a => Floating (Tower a) | |

Fractional a => Fractional (Tower a) | |

Data a => Data (Tower a) | |

Num a => Num (Tower a) | |

(Num a, Ord a) => Ord (Tower a) | |

Real a => Real (Tower a) | |

RealFloat a => RealFloat (Tower a) | |

RealFrac a => RealFrac (Tower a) | |

Show a => Show (Tower a) | |

Erf a => Erf (Tower a) | |

InvErf a => InvErf (Tower a) | |

Num a => Mode (Tower a) | |

Num a => Jacobian (Tower a) | |

Typeable (* -> *) Tower | |

type Scalar (Tower a) = a | |

type D (Tower a) = Tower a |

# Taylor Series

# Maclaurin Series

maclaurin0 :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a] Source

# Derivatives

diffsF :: (Functor f, Num a) => (forall s. AD s (Tower a) -> f (AD s (Tower a))) -> a -> f [a] Source

diffs0F :: (Functor f, Num a) => (forall s. AD s (Tower a) -> f (AD s (Tower a))) -> a -> f [a] Source

# Directional Derivatives

du :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f (a, a) -> a Source

du' :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f (a, a) -> (a, a) Source

dus :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f [a] -> [a] Source

dus0 :: (Functor f, Num a) => (forall s. f (AD s (Tower a)) -> AD s (Tower a)) -> f [a] -> [a] Source

duF :: (Functor f, Functor g, Num a) => (forall s. f (AD s (Tower a)) -> g (AD s (Tower a))) -> f (a, a) -> g a Source

duF' :: (Functor f, Functor g, Num a) => (forall s. f (AD s (Tower a)) -> g (AD s (Tower a))) -> f (a, a) -> g (a, a) Source