ad-4.5.4: Automatic Differentiation
Copyright(c) Edward Kmett 2010-2021
LicenseBSD3
Maintainerekmett@gmail.com
Stabilityexperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.AD.Mode.Tower

Description

Higher order derivatives via a "dual number tower".

Synopsis

Documentation

data AD s a Source #

Instances

Instances details
Mode a => Mode (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Associated Types

type Scalar (AD s a) Source #

Methods

isKnownConstant :: AD s a -> Bool Source #

asKnownConstant :: AD s a -> Maybe (Scalar (AD s a)) 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 #

Bounded a => Bounded (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

minBound :: AD s a #

maxBound :: AD s a #

Enum a => Enum (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

succ :: 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] #

Floating a => Floating (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

pi :: 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 #

RealFloat a => RealFloat (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

floatRadix :: 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 #

Num a => Num (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

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 #

Read a => Read (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

readsPrec :: Int -> ReadS (AD s a) #

readList :: ReadS [AD s a] #

readPrec :: ReadPrec (AD s a) #

readListPrec :: ReadPrec [AD s a] #

Fractional a => Fractional (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

(/) :: AD s a -> AD s a -> AD s a #

recip :: AD s a -> AD s a #

fromRational :: Rational -> AD s a #

Real a => Real (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

toRational :: AD s a -> Rational #

RealFrac a => RealFrac (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

properFraction :: 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 # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

showsPrec :: Int -> AD s a -> ShowS #

show :: AD s a -> String #

showList :: [AD s a] -> ShowS #

Erf a => Erf (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

erf :: 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 # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

inverf :: AD s a -> AD s a #

inverfc :: AD s a -> AD s a #

invnormcdf :: AD s a -> AD s a #

Eq a => Eq (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

(==) :: AD s a -> AD s a -> Bool #

(/=) :: AD s a -> AD s a -> Bool #

Ord a => Ord (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

Methods

compare :: 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 #

type Scalar (AD s a) Source # 
Instance details

Defined in Numeric.AD.Internal.Type

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

Instances details
Num a => Jacobian (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Associated Types

type D (Tower a) Source #

Methods

unary :: (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 #

Num a => Mode (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Associated Types

type Scalar (Tower a) Source #

Data a => Data (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

gfoldl :: (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 :: forall r r'. (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, Bounded a) => Bounded (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

minBound :: Tower a #

maxBound :: Tower a #

(Num a, Enum a) => Enum (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

succ :: 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] #

Floating a => Floating (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

pi :: 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 #

RealFloat a => RealFloat (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Num a => Num (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

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 #

fromInteger :: Integer -> Tower a #

Fractional a => Fractional (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

(/) :: Tower a -> Tower a -> Tower a #

recip :: Tower a -> Tower a #

fromRational :: Rational -> Tower a #

Real a => Real (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

toRational :: Tower a -> Rational #

RealFrac a => RealFrac (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

properFraction :: 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 # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

showsPrec :: Int -> Tower a -> ShowS #

show :: Tower a -> String #

showList :: [Tower a] -> ShowS #

Erf a => Erf (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

erf :: Tower a -> Tower a #

erfc :: Tower a -> Tower a #

erfcx :: Tower a -> Tower a #

normcdf :: Tower a -> Tower a #

InvErf a => InvErf (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

inverf :: Tower a -> Tower a #

inverfc :: Tower a -> Tower a #

invnormcdf :: Tower a -> Tower a #

(Num a, Eq a) => Eq (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

(==) :: Tower a -> Tower a -> Bool #

(/=) :: Tower a -> Tower a -> Bool #

(Num a, Ord a) => Ord (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

Methods

compare :: 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 #

type D (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

type D (Tower a) = Tower a
type Scalar (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

type Scalar (Tower a) = 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 #