ad-4.3.3: 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 # MethodsminBound :: AD s a #maxBound :: AD s a # Enum a => Enum (AD s a) Source # Methodssucc :: AD s a -> AD s a #pred :: AD s a -> AD s a #toEnum :: Int -> AD s a #fromEnum :: AD s a -> Int #enumFrom :: AD s a -> [AD s a] #enumFromThen :: AD s a -> AD s a -> [AD s a] #enumFromTo :: AD s a -> AD s a -> [AD s a] #enumFromThenTo :: AD s a -> AD s a -> AD s a -> [AD s a] # Eq a => Eq (AD s a) Source # Methods(==) :: AD s a -> AD s a -> Bool #(/=) :: AD s a -> AD s a -> Bool # Floating a => Floating (AD s a) Source # Methodspi :: AD s a #exp :: AD s a -> AD s a #log :: AD s a -> AD s a #sqrt :: AD s a -> AD s a #(**) :: AD s a -> AD s a -> AD s a #logBase :: AD s a -> AD s a -> AD s a #sin :: AD s a -> AD s a #cos :: AD s a -> AD s a #tan :: AD s a -> AD s a #asin :: AD s a -> AD s a #acos :: AD s a -> AD s a #atan :: AD s a -> AD s a #sinh :: AD s a -> AD s a #cosh :: AD s a -> AD s a #tanh :: AD s a -> AD s a #asinh :: AD s a -> AD s a #acosh :: AD s a -> AD s a #atanh :: AD s a -> AD s a #log1p :: AD s a -> AD s a #expm1 :: AD s a -> AD s a #log1pexp :: AD s a -> AD s a #log1mexp :: AD s a -> AD s a # Fractional a => Fractional (AD s a) Source # Methods(/) :: AD s a -> AD s a -> AD s a #recip :: AD s a -> AD s a #fromRational :: Rational -> AD s a # Num a => Num (AD s a) Source # Methods(+) :: AD s a -> AD s a -> AD s a #(-) :: AD s a -> AD s a -> AD s a #(*) :: AD s a -> AD s a -> AD s a #negate :: AD s a -> AD s a #abs :: AD s a -> AD s a #signum :: AD s a -> AD s a #fromInteger :: Integer -> AD s a # Ord a => Ord (AD s a) Source # Methodscompare :: AD s a -> AD s a -> Ordering #(<) :: AD s a -> AD s a -> Bool #(<=) :: AD s a -> AD s a -> Bool #(>) :: AD s a -> AD s a -> Bool #(>=) :: AD s a -> AD s a -> Bool #max :: AD s a -> AD s a -> AD s a #min :: AD s a -> AD s a -> AD s a # Read a => Read (AD s a) Source # MethodsreadsPrec :: Int -> ReadS (AD s a) #readList :: ReadS [AD s a] #readPrec :: ReadPrec (AD s a) #readListPrec :: ReadPrec [AD s a] # Real a => Real (AD s a) Source # MethodstoRational :: AD s a -> Rational # RealFloat a => RealFloat (AD s a) Source # MethodsfloatRadix :: AD s a -> Integer #floatDigits :: AD s a -> Int #floatRange :: AD s a -> (Int, Int) #decodeFloat :: AD s a -> (Integer, Int) #encodeFloat :: Integer -> Int -> AD s a #exponent :: AD s a -> Int #significand :: AD s a -> AD s a #scaleFloat :: Int -> AD s a -> AD s a #isNaN :: AD s a -> Bool #isInfinite :: AD s a -> Bool #isDenormalized :: AD s a -> Bool #isNegativeZero :: AD s a -> Bool #isIEEE :: AD s a -> Bool #atan2 :: AD s a -> AD s a -> AD s a # RealFrac a => RealFrac (AD s a) Source # MethodsproperFraction :: Integral b => AD s a -> (b, AD s a) #truncate :: Integral b => AD s a -> b #round :: Integral b => AD s a -> b #ceiling :: Integral b => AD s a -> b #floor :: Integral b => AD s a -> b # Show a => Show (AD s a) Source # MethodsshowsPrec :: Int -> AD s a -> ShowS #show :: AD s a -> String #showList :: [AD s a] -> ShowS # Erf a => Erf (AD s a) Source # Methodserf :: AD s a -> AD s a #erfc :: AD s a -> AD s a #erfcx :: AD s a -> AD s a #normcdf :: AD s a -> AD s a # InvErf a => InvErf (AD s a) Source # Methodsinverf :: AD s a -> AD s a #inverfc :: AD s a -> AD s a #invnormcdf :: AD s a -> AD s a # Mode a => Mode (AD s a) Source # Associated Typestype Scalar (AD s a) :: * Source # MethodsisKnownConstant :: AD s a -> Bool Source #isKnownZero :: AD s a -> Bool Source #auto :: Scalar (AD s a) -> AD s a Source #(*^) :: Scalar (AD s a) -> AD s a -> AD s a Source #(^*) :: AD s a -> Scalar (AD s a) -> AD s a Source #(^/) :: AD s a -> Scalar (AD s a) -> AD s a Source #zero :: AD s a Source # type Scalar (AD s a) Source # type Scalar (AD s a) = Scalar a

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) # Methods (Num a, Enum a) => Enum (Tower a) # Methodssucc :: Tower a -> Tower a #pred :: Tower a -> Tower a #toEnum :: Int -> Tower a #fromEnum :: Tower a -> Int #enumFrom :: Tower a -> [Tower a] #enumFromThen :: Tower a -> Tower a -> [Tower a] #enumFromTo :: Tower a -> Tower a -> [Tower a] #enumFromThenTo :: Tower a -> Tower a -> Tower a -> [Tower a] # (Num a, Eq a) => Eq (Tower a) # Methods(==) :: Tower a -> Tower a -> Bool #(/=) :: Tower a -> Tower a -> Bool # Floating a => Floating (Tower a) # Methodspi :: Tower a #exp :: Tower a -> Tower a #log :: Tower a -> Tower a #sqrt :: Tower a -> Tower a #(**) :: Tower a -> Tower a -> Tower a #logBase :: Tower a -> Tower a -> Tower a #sin :: Tower a -> Tower a #cos :: Tower a -> Tower a #tan :: Tower a -> Tower a #asin :: Tower a -> Tower a #acos :: Tower a -> Tower a #atan :: Tower a -> Tower a #sinh :: Tower a -> Tower a #cosh :: Tower a -> Tower a #tanh :: Tower a -> Tower a #asinh :: Tower a -> Tower a #acosh :: Tower a -> Tower a #atanh :: Tower a -> Tower a #log1p :: Tower a -> Tower a #expm1 :: Tower a -> Tower a #log1pexp :: Tower a -> Tower a #log1mexp :: Tower a -> Tower a # Fractional a => Fractional (Tower a) # Methods(/) :: Tower a -> Tower a -> Tower a #recip :: Tower a -> Tower a # Data a => Data (Tower a) Source # Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Tower a -> c (Tower a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tower a) #toConstr :: Tower a -> Constr #dataTypeOf :: Tower a -> DataType #dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Tower a)) #dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tower a)) #gmapT :: (forall b. Data b => b -> b) -> Tower a -> Tower a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tower a -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tower a -> r #gmapQ :: (forall d. Data d => d -> u) -> Tower a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Tower a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tower a -> m (Tower a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tower a -> m (Tower a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tower a -> m (Tower a) # Num a => Num (Tower a) # Methods(+) :: Tower a -> Tower a -> Tower a #(-) :: Tower a -> Tower a -> Tower a #(*) :: Tower a -> Tower a -> Tower a #negate :: Tower a -> Tower a #abs :: Tower a -> Tower a #signum :: Tower a -> Tower a # (Num a, Ord a) => Ord (Tower a) # Methodscompare :: Tower a -> Tower a -> Ordering #(<) :: Tower a -> Tower a -> Bool #(<=) :: Tower a -> Tower a -> Bool #(>) :: Tower a -> Tower a -> Bool #(>=) :: Tower a -> Tower a -> Bool #max :: Tower a -> Tower a -> Tower a #min :: Tower a -> Tower a -> Tower a # Real a => Real (Tower a) # MethodstoRational :: Tower a -> Rational # RealFloat a => RealFloat (Tower a) # MethodsfloatRadix :: Tower a -> Integer #floatDigits :: Tower a -> Int #floatRange :: Tower a -> (Int, Int) #decodeFloat :: Tower a -> (Integer, Int) #encodeFloat :: Integer -> Int -> Tower a #exponent :: Tower a -> Int #significand :: Tower a -> Tower a #scaleFloat :: Int -> Tower a -> Tower a #isNaN :: Tower a -> Bool #isInfinite :: Tower a -> Bool #isDenormalized :: Tower a -> Bool #isNegativeZero :: Tower a -> Bool #isIEEE :: Tower a -> Bool #atan2 :: Tower a -> Tower a -> Tower a # RealFrac a => RealFrac (Tower a) # MethodsproperFraction :: Integral b => Tower a -> (b, Tower a) #truncate :: Integral b => Tower a -> b #round :: Integral b => Tower a -> b #ceiling :: Integral b => Tower a -> b #floor :: Integral b => Tower a -> b # Show a => Show (Tower a) Source # MethodsshowsPrec :: Int -> Tower a -> ShowS #show :: Tower a -> String #showList :: [Tower a] -> ShowS # Erf a => Erf (Tower a) # Methodserf :: Tower a -> Tower a #erfc :: Tower a -> Tower a #erfcx :: Tower a -> Tower a #normcdf :: Tower a -> Tower a # InvErf a => InvErf (Tower a) # Methodsinverf :: Tower a -> Tower a #inverfc :: Tower a -> Tower a #invnormcdf :: Tower a -> Tower a # Num a => Mode (Tower a) Source # Associated Typestype Scalar (Tower a) :: * Source # Methodsauto :: Scalar (Tower a) -> Tower a Source #(*^) :: Scalar (Tower a) -> Tower a -> Tower a Source #(^*) :: Tower a -> Scalar (Tower a) -> Tower a Source #(^/) :: Tower a -> Scalar (Tower a) -> Tower a Source # Num a => Jacobian (Tower a) Source # Associated Typestype D (Tower a) :: * Source # Methodsunary :: (Scalar (Tower a) -> Scalar (Tower a)) -> D (Tower a) -> Tower a -> Tower a Source #lift1 :: (Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a)) -> Tower a -> Tower a Source #lift1_ :: (Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a) -> D (Tower a)) -> Tower a -> Tower a Source #binary :: (Scalar (Tower a) -> Scalar (Tower a) -> Scalar (Tower a)) -> D (Tower a) -> D (Tower a) -> Tower a -> Tower a -> Tower a Source #lift2 :: (Scalar (Tower a) -> Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a) -> (D (Tower a), D (Tower a))) -> Tower a -> Tower a -> Tower a Source #lift2_ :: (Scalar (Tower a) -> Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a) -> D (Tower a) -> (D (Tower a), D (Tower a))) -> Tower a -> Tower a -> Tower a Source # type Scalar (Tower a) Source # type Scalar (Tower a) = a type D (Tower a) Source # type D (Tower a) = Tower a

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 #