{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
module Numeric.AD.Mode.Kahn.Double
( AD, Kahn, KahnDouble, auto
, grad
, grad'
, gradWith
, gradWith'
, jacobian
, jacobian'
, jacobianWith
, jacobianWith'
, hessian
, hessianF
, diff
, diff'
, diffF
, diffF'
) where
import Numeric.AD.Internal.Kahn (Kahn)
import Numeric.AD.Internal.Kahn.Double (KahnDouble)
import Numeric.AD.Internal.On
import Numeric.AD.Internal.Type (AD(..))
import Numeric.AD.Mode
import qualified Numeric.AD.Rank1.Kahn.Double as Rank1
grad
:: Traversable f
=> (forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double
-> f Double
grad :: forall (f :: * -> *).
Traversable f =>
(forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double -> f Double
grad forall s. f (AD s KahnDouble) -> AD s KahnDouble
f = (f KahnDouble -> KahnDouble) -> f Double -> f Double
forall (f :: * -> *).
Traversable f =>
(f KahnDouble -> KahnDouble) -> f Double -> f Double
Rank1.grad (AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(AD Any KahnDouble -> KahnDouble)
-> (f KahnDouble -> AD Any KahnDouble)
-> f KahnDouble
-> KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> AD Any KahnDouble
forall s. f (AD s KahnDouble) -> AD s KahnDouble
f(f (AD Any KahnDouble) -> AD Any KahnDouble)
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> AD Any KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE grad #-}
grad'
:: Traversable f
=> (forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double
-> (Double, f Double)
grad' :: forall (f :: * -> *).
Traversable f =>
(forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double -> (Double, f Double)
grad' forall s. f (AD s KahnDouble) -> AD s KahnDouble
f = (f KahnDouble -> KahnDouble) -> f Double -> (Double, f Double)
forall (f :: * -> *).
Traversable f =>
(f KahnDouble -> KahnDouble) -> f Double -> (Double, f Double)
Rank1.grad' (AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(AD Any KahnDouble -> KahnDouble)
-> (f KahnDouble -> AD Any KahnDouble)
-> f KahnDouble
-> KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> AD Any KahnDouble
forall s. f (AD s KahnDouble) -> AD s KahnDouble
f(f (AD Any KahnDouble) -> AD Any KahnDouble)
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> AD Any KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE grad' #-}
gradWith
:: Traversable f
=> (Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double -> f b
gradWith :: forall (f :: * -> *) b.
Traversable f =>
(Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double
-> f b
gradWith Double -> Double -> b
g forall s. f (AD s KahnDouble) -> AD s KahnDouble
f = (Double -> Double -> b)
-> (f KahnDouble -> KahnDouble) -> f Double -> f b
forall (f :: * -> *) b.
Traversable f =>
(Double -> Double -> b)
-> (f KahnDouble -> KahnDouble) -> f Double -> f b
Rank1.gradWith Double -> Double -> b
g (AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(AD Any KahnDouble -> KahnDouble)
-> (f KahnDouble -> AD Any KahnDouble)
-> f KahnDouble
-> KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> AD Any KahnDouble
forall s. f (AD s KahnDouble) -> AD s KahnDouble
f(f (AD Any KahnDouble) -> AD Any KahnDouble)
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> AD Any KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE gradWith #-}
gradWith'
:: Traversable f
=> (Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double -> (Double, f b)
gradWith' :: forall (f :: * -> *) b.
Traversable f =>
(Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> AD s KahnDouble)
-> f Double
-> (Double, f b)
gradWith' Double -> Double -> b
g forall s. f (AD s KahnDouble) -> AD s KahnDouble
f = (Double -> Double -> b)
-> (f KahnDouble -> KahnDouble) -> f Double -> (Double, f b)
forall (f :: * -> *) b.
Traversable f =>
(Double -> Double -> b)
-> (f KahnDouble -> KahnDouble) -> f Double -> (Double, f b)
Rank1.gradWith' Double -> Double -> b
g (AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(AD Any KahnDouble -> KahnDouble)
-> (f KahnDouble -> AD Any KahnDouble)
-> f KahnDouble
-> KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> AD Any KahnDouble
forall s. f (AD s KahnDouble) -> AD s KahnDouble
f(f (AD Any KahnDouble) -> AD Any KahnDouble)
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> AD Any KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE gradWith' #-}
jacobian
:: (Traversable f, Functor g)
=> (forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double -> g (f Double)
jacobian :: forall (f :: * -> *) (g :: * -> *).
(Traversable f, Functor g) =>
(forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double -> g (f Double)
jacobian forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f = (f KahnDouble -> g KahnDouble) -> f Double -> g (f Double)
forall (f :: * -> *) (g :: * -> *).
(Traversable f, Functor g) =>
(f KahnDouble -> g KahnDouble) -> f Double -> g (f Double)
Rank1.jacobian ((AD Any KahnDouble -> KahnDouble)
-> g (AD Any KahnDouble) -> g KahnDouble
forall a b. (a -> b) -> g a -> g b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(g (AD Any KahnDouble) -> g KahnDouble)
-> (f KahnDouble -> g (AD Any KahnDouble))
-> f KahnDouble
-> g KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> g (AD Any KahnDouble)
forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f(f (AD Any KahnDouble) -> g (AD Any KahnDouble))
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> g (AD Any KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE jacobian #-}
jacobian'
:: (Traversable f, Functor g)
=> (forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double -> g (Double, f Double)
jacobian' :: forall (f :: * -> *) (g :: * -> *).
(Traversable f, Functor g) =>
(forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double -> g (Double, f Double)
jacobian' forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f = (f KahnDouble -> g KahnDouble) -> f Double -> g (Double, f Double)
forall (f :: * -> *) (g :: * -> *).
(Traversable f, Functor g) =>
(f KahnDouble -> g KahnDouble) -> f Double -> g (Double, f Double)
Rank1.jacobian' ((AD Any KahnDouble -> KahnDouble)
-> g (AD Any KahnDouble) -> g KahnDouble
forall a b. (a -> b) -> g a -> g b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(g (AD Any KahnDouble) -> g KahnDouble)
-> (f KahnDouble -> g (AD Any KahnDouble))
-> f KahnDouble
-> g KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> g (AD Any KahnDouble)
forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f(f (AD Any KahnDouble) -> g (AD Any KahnDouble))
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> g (AD Any KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE jacobian' #-}
jacobianWith
:: (Traversable f, Functor g)
=> (Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double -> g (f b)
jacobianWith :: forall (f :: * -> *) (g :: * -> *) b.
(Traversable f, Functor g) =>
(Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double
-> g (f b)
jacobianWith Double -> Double -> b
g forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f = (Double -> Double -> b)
-> (f KahnDouble -> g KahnDouble) -> f Double -> g (f b)
forall (f :: * -> *) (g :: * -> *) b.
(Traversable f, Functor g) =>
(Double -> Double -> b)
-> (f KahnDouble -> g KahnDouble) -> f Double -> g (f b)
Rank1.jacobianWith Double -> Double -> b
g ((AD Any KahnDouble -> KahnDouble)
-> g (AD Any KahnDouble) -> g KahnDouble
forall a b. (a -> b) -> g a -> g b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(g (AD Any KahnDouble) -> g KahnDouble)
-> (f KahnDouble -> g (AD Any KahnDouble))
-> f KahnDouble
-> g KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> g (AD Any KahnDouble)
forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f(f (AD Any KahnDouble) -> g (AD Any KahnDouble))
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> g (AD Any KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE jacobianWith #-}
jacobianWith'
:: (Traversable f, Functor g)
=> (Double -> Double -> b) -> (forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double -> g (Double, f b)
jacobianWith' :: forall (f :: * -> *) (g :: * -> *) b.
(Traversable f, Functor g) =>
(Double -> Double -> b)
-> (forall s. f (AD s KahnDouble) -> g (AD s KahnDouble))
-> f Double
-> g (Double, f b)
jacobianWith' Double -> Double -> b
g forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f = (Double -> Double -> b)
-> (f KahnDouble -> g KahnDouble) -> f Double -> g (Double, f b)
forall (f :: * -> *) (g :: * -> *) b.
(Traversable f, Functor g) =>
(Double -> Double -> b)
-> (f KahnDouble -> g KahnDouble) -> f Double -> g (Double, f b)
Rank1.jacobianWith' Double -> Double -> b
g ((AD Any KahnDouble -> KahnDouble)
-> g (AD Any KahnDouble) -> g KahnDouble
forall a b. (a -> b) -> g a -> g b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(g (AD Any KahnDouble) -> g KahnDouble)
-> (f KahnDouble -> g (AD Any KahnDouble))
-> f KahnDouble
-> g KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any KahnDouble) -> g (AD Any KahnDouble)
forall s. f (AD s KahnDouble) -> g (AD s KahnDouble)
f(f (AD Any KahnDouble) -> g (AD Any KahnDouble))
-> (f KahnDouble -> f (AD Any KahnDouble))
-> f KahnDouble
-> g (AD Any KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(KahnDouble -> AD Any KahnDouble)
-> f KahnDouble -> f (AD Any KahnDouble)
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE jacobianWith' #-}
diff
:: (forall s. AD s KahnDouble -> AD s KahnDouble) -> Double -> Double
diff :: (forall s. AD s KahnDouble -> AD s KahnDouble) -> Double -> Double
diff forall s. AD s KahnDouble -> AD s KahnDouble
f = (KahnDouble -> KahnDouble) -> Double -> Double
Rank1.diff (AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(AD Any KahnDouble -> KahnDouble)
-> (KahnDouble -> AD Any KahnDouble) -> KahnDouble -> KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any KahnDouble -> AD Any KahnDouble
forall s. AD s KahnDouble -> AD s KahnDouble
f(AD Any KahnDouble -> AD Any KahnDouble)
-> (KahnDouble -> AD Any KahnDouble)
-> KahnDouble
-> AD Any KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE diff #-}
diff'
:: (forall s. AD s KahnDouble -> AD s KahnDouble)
-> Double
-> (Double, Double)
diff' :: (forall s. AD s KahnDouble -> AD s KahnDouble)
-> Double -> (Double, Double)
diff' forall s. AD s KahnDouble -> AD s KahnDouble
f = (KahnDouble -> KahnDouble) -> Double -> (Double, Double)
Rank1.diff' (AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(AD Any KahnDouble -> KahnDouble)
-> (KahnDouble -> AD Any KahnDouble) -> KahnDouble -> KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any KahnDouble -> AD Any KahnDouble
forall s. AD s KahnDouble -> AD s KahnDouble
f(AD Any KahnDouble -> AD Any KahnDouble)
-> (KahnDouble -> AD Any KahnDouble)
-> KahnDouble
-> AD Any KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE diff' #-}
diffF
:: Functor f
=> (forall s. AD s KahnDouble -> f (AD s KahnDouble))
-> Double
-> f Double
diffF :: forall (f :: * -> *).
Functor f =>
(forall s. AD s KahnDouble -> f (AD s KahnDouble))
-> Double -> f Double
diffF forall s. AD s KahnDouble -> f (AD s KahnDouble)
f = (KahnDouble -> f KahnDouble) -> Double -> f Double
forall (f :: * -> *).
Functor f =>
(KahnDouble -> f KahnDouble) -> Double -> f Double
Rank1.diffF ((AD Any KahnDouble -> KahnDouble)
-> f (AD Any KahnDouble) -> f KahnDouble
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(f (AD Any KahnDouble) -> f KahnDouble)
-> (KahnDouble -> f (AD Any KahnDouble))
-> KahnDouble
-> f KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any KahnDouble -> f (AD Any KahnDouble)
forall s. AD s KahnDouble -> f (AD s KahnDouble)
f(AD Any KahnDouble -> f (AD Any KahnDouble))
-> (KahnDouble -> AD Any KahnDouble)
-> KahnDouble
-> f (AD Any KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE diffF #-}
diffF'
:: Functor f
=> (forall s. AD s KahnDouble -> f (AD s KahnDouble))
-> Double
-> f (Double, Double)
diffF' :: forall (f :: * -> *).
Functor f =>
(forall s. AD s KahnDouble -> f (AD s KahnDouble))
-> Double -> f (Double, Double)
diffF' forall s. AD s KahnDouble -> f (AD s KahnDouble)
f = (KahnDouble -> f KahnDouble) -> Double -> f (Double, Double)
forall (f :: * -> *).
Functor f =>
(KahnDouble -> f KahnDouble) -> Double -> f (Double, Double)
Rank1.diffF' ((AD Any KahnDouble -> KahnDouble)
-> f (AD Any KahnDouble) -> f KahnDouble
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any KahnDouble -> KahnDouble
forall s a. AD s a -> a
runAD(f (AD Any KahnDouble) -> f KahnDouble)
-> (KahnDouble -> f (AD Any KahnDouble))
-> KahnDouble
-> f KahnDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any KahnDouble -> f (AD Any KahnDouble)
forall s. AD s KahnDouble -> f (AD s KahnDouble)
f(AD Any KahnDouble -> f (AD Any KahnDouble))
-> (KahnDouble -> AD Any KahnDouble)
-> KahnDouble
-> f (AD Any KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.KahnDouble -> AD Any KahnDouble
forall s a. a -> AD s a
AD)
{-# INLINE diffF' #-}
hessian
:: Traversable f
=> (forall s. f (AD s (On (Kahn KahnDouble))) -> AD s (On (Kahn KahnDouble)))
-> f Double -> f (f Double)
hessian :: forall (f :: * -> *).
Traversable f =>
(forall s.
f (AD s (On (Kahn KahnDouble))) -> AD s (On (Kahn KahnDouble)))
-> f Double -> f (f Double)
hessian forall s.
f (AD s (On (Kahn KahnDouble))) -> AD s (On (Kahn KahnDouble))
f = (f (On (Kahn KahnDouble)) -> On (Kahn KahnDouble))
-> f Double -> f (f Double)
forall (f :: * -> *).
Traversable f =>
(f (On (Kahn KahnDouble)) -> On (Kahn KahnDouble))
-> f Double -> f (f Double)
Rank1.hessian (AD Any (On (Kahn KahnDouble)) -> On (Kahn KahnDouble)
forall s a. AD s a -> a
runAD(AD Any (On (Kahn KahnDouble)) -> On (Kahn KahnDouble))
-> (f (On (Kahn KahnDouble)) -> AD Any (On (Kahn KahnDouble)))
-> f (On (Kahn KahnDouble))
-> On (Kahn KahnDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any (On (Kahn KahnDouble))) -> AD Any (On (Kahn KahnDouble))
forall s.
f (AD s (On (Kahn KahnDouble))) -> AD s (On (Kahn KahnDouble))
f(f (AD Any (On (Kahn KahnDouble)))
-> AD Any (On (Kahn KahnDouble)))
-> (f (On (Kahn KahnDouble)) -> f (AD Any (On (Kahn KahnDouble))))
-> f (On (Kahn KahnDouble))
-> AD Any (On (Kahn KahnDouble))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(On (Kahn KahnDouble) -> AD Any (On (Kahn KahnDouble)))
-> f (On (Kahn KahnDouble)) -> f (AD Any (On (Kahn KahnDouble)))
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap On (Kahn KahnDouble) -> AD Any (On (Kahn KahnDouble))
forall s a. a -> AD s a
AD)
hessianF
:: (Traversable f, Functor g)
=> (forall s. f (AD s (On (Kahn KahnDouble))) -> g (AD s (On (Kahn KahnDouble))))
-> f Double -> g (f (f Double))
hessianF :: forall (f :: * -> *) (g :: * -> *).
(Traversable f, Functor g) =>
(forall s.
f (AD s (On (Kahn KahnDouble))) -> g (AD s (On (Kahn KahnDouble))))
-> f Double -> g (f (f Double))
hessianF forall s.
f (AD s (On (Kahn KahnDouble))) -> g (AD s (On (Kahn KahnDouble)))
f = (f (On (Kahn KahnDouble)) -> g (On (Kahn KahnDouble)))
-> f Double -> g (f (f Double))
forall (f :: * -> *) (g :: * -> *).
(Traversable f, Functor g) =>
(f (On (Kahn KahnDouble)) -> g (On (Kahn KahnDouble)))
-> f Double -> g (f (f Double))
Rank1.hessianF ((AD Any (On (Kahn KahnDouble)) -> On (Kahn KahnDouble))
-> g (AD Any (On (Kahn KahnDouble))) -> g (On (Kahn KahnDouble))
forall a b. (a -> b) -> g a -> g b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AD Any (On (Kahn KahnDouble)) -> On (Kahn KahnDouble)
forall s a. AD s a -> a
runAD(g (AD Any (On (Kahn KahnDouble))) -> g (On (Kahn KahnDouble)))
-> (f (On (Kahn KahnDouble)) -> g (AD Any (On (Kahn KahnDouble))))
-> f (On (Kahn KahnDouble))
-> g (On (Kahn KahnDouble))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.f (AD Any (On (Kahn KahnDouble)))
-> g (AD Any (On (Kahn KahnDouble)))
forall s.
f (AD s (On (Kahn KahnDouble))) -> g (AD s (On (Kahn KahnDouble)))
f(f (AD Any (On (Kahn KahnDouble)))
-> g (AD Any (On (Kahn KahnDouble))))
-> (f (On (Kahn KahnDouble)) -> f (AD Any (On (Kahn KahnDouble))))
-> f (On (Kahn KahnDouble))
-> g (AD Any (On (Kahn KahnDouble)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(On (Kahn KahnDouble) -> AD Any (On (Kahn KahnDouble)))
-> f (On (Kahn KahnDouble)) -> f (AD Any (On (Kahn KahnDouble)))
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap On (Kahn KahnDouble) -> AD Any (On (Kahn KahnDouble))
forall s a. a -> AD s a
AD)