ad-4.3.1: Automatic Differentiation

Copyright (c) Edward Kmett 2010-2015 BSD3 ekmett@gmail.com experimental GHC only None Haskell2010

Numeric.AD.Mode.Tower

Description

Higher order derivatives via a "dual number tower".

Synopsis

# Documentation

data AD s a Source

Instances

 Bounded a => Bounded (AD s a) Source Enum a => Enum (AD s a) Source Eq a => Eq (AD s a) Source Floating a => Floating (AD s a) Source Fractional a => Fractional (AD s a) Source Num a => Num (AD s a) Source Ord a => Ord (AD s a) Source Read a => Read (AD s a) Source Real a => Real (AD s a) Source RealFloat a => RealFloat (AD s a) Source RealFrac a => RealFrac (AD s a) Source Show a => Show (AD s a) Source Erf a => Erf (AD s a) Source InvErf a => InvErf (AD s a) Source Mode a => Mode (AD s a) Source type Scalar (AD s a) = Scalar a Source

data Tower a Source

`Tower` is an AD `Mode` that calculates a tangent tower by forward AD, and provides fast `diffsUU`, `diffsUF`

Instances

 (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) Source 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) Source Erf a => Erf (Tower a) InvErf a => InvErf (Tower a) Num a => Mode (Tower a) Source Num a => Jacobian (Tower a) Source type Scalar (Tower a) = a Source type D (Tower a) = Tower a Source

auto :: Mode t => Scalar t -> t Source

Embed a constant

# Taylor Series

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

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

# Maclaurin Series

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

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

# Derivatives

diff :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> a Source

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

diffs :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a] Source

diffs0 :: Num a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> [a] Source

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

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

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