ad-4.3: Automatic Differentiation

Copyright(c) Edward Kmett 2010-2015
PortabilityGHC only
Safe HaskellNone



Unsafe and often partial combinators intended for internal usage.

Handle with care.



data Forward a Source

Forward mode AD


Forward !a a 
Lift !a 


(Num a, Bounded a) => Bounded (Forward a) 
(Num a, Enum a) => Enum (Forward a) 
(Num a, Eq a) => Eq (Forward a) 
Floating a => Floating (Forward a) 
Fractional a => Fractional (Forward a) 
Data a => Data (Forward a) Source 
Num a => Num (Forward a) 
(Num a, Ord a) => Ord (Forward a) 
Real a => Real (Forward a) 
RealFloat a => RealFloat (Forward a) 
RealFrac a => RealFrac (Forward a) 
Show a => Show (Forward a) Source 
Erf a => Erf (Forward a) 
InvErf a => InvErf (Forward a) 
Num a => Mode (Forward a) Source 
Num a => Jacobian (Forward a) Source 
type Scalar (Forward a) = a Source 
type D (Forward a) = Id a Source 

primal :: Num a => Forward a -> a Source

tangent :: Num a => Forward a -> a Source

Calculate the tangent using forward mode AD.

bundle :: a -> a -> Forward a Source

unbundle :: Num a => Forward a -> (a, a) Source

apply :: Num a => (Forward a -> b) -> a -> b Source

bind :: (Traversable f, Num a) => (f (Forward a) -> b) -> f a -> f b Source

bind' :: (Traversable f, Num a) => (f (Forward a) -> b) -> f a -> (b, f b) Source

bindWith :: (Traversable f, Num a) => (a -> b -> c) -> (f (Forward a) -> b) -> f a -> f c Source

bindWith' :: (Traversable f, Num a) => (a -> b -> c) -> (f (Forward a) -> b) -> f a -> (b, f c) Source

transposeWith :: (Functor f, Foldable f, Traversable g) => (b -> f a -> c) -> f (g a) -> g b -> g c Source