Copyright | (c) Edward Kmett 2010-2021 |
---|---|
License | BSD3 |
Maintainer | ekmett@gmail.com |
Stability | experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Higher order derivatives via a "dual number tower".
Synopsis
- data TowerDouble
- auto :: Mode t => Scalar t -> t
- taylor :: (TowerDouble -> TowerDouble) -> Double -> Double -> [Double]
- taylor0 :: (TowerDouble -> TowerDouble) -> Double -> Double -> [Double]
- maclaurin :: (TowerDouble -> TowerDouble) -> Double -> [Double]
- maclaurin0 :: (TowerDouble -> TowerDouble) -> Double -> [Double]
- diff :: (TowerDouble -> TowerDouble) -> Double -> Double
- diff' :: (TowerDouble -> TowerDouble) -> Double -> (Double, Double)
- diffs :: (TowerDouble -> TowerDouble) -> Double -> [Double]
- diffs0 :: (TowerDouble -> TowerDouble) -> Double -> [Double]
- diffsF :: Functor f => (TowerDouble -> f TowerDouble) -> Double -> f [Double]
- diffs0F :: Functor f => (TowerDouble -> f TowerDouble) -> Double -> f [Double]
- du :: Functor f => (f TowerDouble -> TowerDouble) -> f (Double, Double) -> Double
- du' :: Functor f => (f TowerDouble -> TowerDouble) -> f (Double, Double) -> (Double, Double)
- dus :: Functor f => (f TowerDouble -> TowerDouble) -> f [Double] -> [Double]
- dus0 :: Functor f => (f TowerDouble -> TowerDouble) -> f [Double] -> [Double]
- duF :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f (Double, Double) -> g Double
- duF' :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f (Double, Double) -> g (Double, Double)
- dusF :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f [Double] -> g [Double]
- dus0F :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f [Double] -> g [Double]
Documentation
data TowerDouble Source #
Tower
is an AD Mode
that calculates a tangent tower by forward AD, and provides fast diffsUU
, diffsUF
Instances
Taylor Series
taylor :: (TowerDouble -> TowerDouble) -> Double -> Double -> [Double] Source #
taylor f x
compute the Taylor series of f
around x
.
taylor0 :: (TowerDouble -> TowerDouble) -> Double -> Double -> [Double] Source #
taylor0 f x
compute the Taylor series of f
around x
, zero-padded.
Maclaurin Series
maclaurin :: (TowerDouble -> TowerDouble) -> Double -> [Double] Source #
maclaurin f
compute the Maclaurin series of f
maclaurin0 :: (TowerDouble -> TowerDouble) -> Double -> [Double] Source #
maclaurin f
compute the Maclaurin series of f
, zero-padded
Derivatives
diff :: (TowerDouble -> TowerDouble) -> Double -> Double Source #
Compute the first derivative of a function (a -> a)
diff' :: (TowerDouble -> TowerDouble) -> Double -> (Double, Double) Source #
Compute the answer and first derivative of a function (a -> a)
diffs :: (TowerDouble -> TowerDouble) -> Double -> [Double] Source #
Compute the answer and all derivatives of a function (a -> a)
diffs0 :: (TowerDouble -> TowerDouble) -> Double -> [Double] Source #
Compute the zero-padded derivatives of a function (a -> a)
diffsF :: Functor f => (TowerDouble -> f TowerDouble) -> Double -> f [Double] Source #
Compute the answer and all derivatives of a function (a -> f a)
diffs0F :: Functor f => (TowerDouble -> f TowerDouble) -> Double -> f [Double] Source #
Compute the zero-padded derivatives of a function (a -> f a)
Directional Derivatives
du :: Functor f => (f TowerDouble -> TowerDouble) -> f (Double, Double) -> Double Source #
Compute a directional derivative of a function (f a -> a)
du' :: Functor f => (f TowerDouble -> TowerDouble) -> f (Double, Double) -> (Double, Double) Source #
Compute the answer and a directional derivative of a function (f a -> a)
dus :: Functor f => (f TowerDouble -> TowerDouble) -> f [Double] -> [Double] Source #
Given a function (f a -> a)
, and a tower of derivatives, compute the corresponding directional derivatives.
dus0 :: Functor f => (f TowerDouble -> TowerDouble) -> f [Double] -> [Double] Source #
Given a function (f a -> a)
, and a tower of derivatives, compute the corresponding directional derivatives, zero-padded
duF :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f (Double, Double) -> g Double Source #
Compute a directional derivative of a function (f a -> g a)
duF' :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f (Double, Double) -> g (Double, Double) Source #
Compute the answer and a directional derivative of a function (f a -> g a)
dusF :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f [Double] -> g [Double] Source #
Given a function (f a -> g a)
, and a tower of derivatives, compute the corresponding directional derivatives
dus0F :: (Functor f, Functor g) => (f TowerDouble -> g TowerDouble) -> f [Double] -> g [Double] Source #
Given a function (f a -> g a)
, and a tower of derivatives, compute the corresponding directional derivatives, zero-padded