{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Numeric.AD.Halley.Double
(
findZero
, inverse
, fixedPoint
, extremum
) where
import Prelude
import Numeric.AD.Internal.Forward (Forward)
import Numeric.AD.Internal.On
import Numeric.AD.Internal.Tower.Double (TowerDouble)
import Numeric.AD.Internal.Type (AD(..))
import qualified Numeric.AD.Rank1.Halley.Double as Rank1
findZero :: (forall s. AD s TowerDouble -> AD s TowerDouble) -> Double -> [Double]
findZero :: (forall s. AD s TowerDouble -> AD s TowerDouble)
-> Double -> [Double]
findZero forall s. AD s TowerDouble -> AD s TowerDouble
f = (TowerDouble -> TowerDouble) -> Double -> [Double]
Rank1.findZero (AD Any TowerDouble -> TowerDouble
forall s a. AD s a -> a
runAD(AD Any TowerDouble -> TowerDouble)
-> (TowerDouble -> AD Any TowerDouble)
-> TowerDouble
-> TowerDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any TowerDouble -> AD Any TowerDouble
forall s. AD s TowerDouble -> AD s TowerDouble
f(AD Any TowerDouble -> AD Any TowerDouble)
-> (TowerDouble -> AD Any TowerDouble)
-> TowerDouble
-> AD Any TowerDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.TowerDouble -> AD Any TowerDouble
forall s a. a -> AD s a
AD)
{-# INLINE findZero #-}
inverse :: (forall s. AD s TowerDouble -> AD s TowerDouble) -> Double -> Double -> [Double]
inverse :: (forall s. AD s TowerDouble -> AD s TowerDouble)
-> Double -> Double -> [Double]
inverse forall s. AD s TowerDouble -> AD s TowerDouble
f = (TowerDouble -> TowerDouble) -> Double -> Double -> [Double]
Rank1.inverse (AD Any TowerDouble -> TowerDouble
forall s a. AD s a -> a
runAD(AD Any TowerDouble -> TowerDouble)
-> (TowerDouble -> AD Any TowerDouble)
-> TowerDouble
-> TowerDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any TowerDouble -> AD Any TowerDouble
forall s. AD s TowerDouble -> AD s TowerDouble
f(AD Any TowerDouble -> AD Any TowerDouble)
-> (TowerDouble -> AD Any TowerDouble)
-> TowerDouble
-> AD Any TowerDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.TowerDouble -> AD Any TowerDouble
forall s a. a -> AD s a
AD)
{-# INLINE inverse #-}
fixedPoint :: (forall s. AD s TowerDouble -> AD s TowerDouble) -> Double -> [Double]
fixedPoint :: (forall s. AD s TowerDouble -> AD s TowerDouble)
-> Double -> [Double]
fixedPoint forall s. AD s TowerDouble -> AD s TowerDouble
f = (TowerDouble -> TowerDouble) -> Double -> [Double]
Rank1.fixedPoint (AD Any TowerDouble -> TowerDouble
forall s a. AD s a -> a
runAD(AD Any TowerDouble -> TowerDouble)
-> (TowerDouble -> AD Any TowerDouble)
-> TowerDouble
-> TowerDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any TowerDouble -> AD Any TowerDouble
forall s. AD s TowerDouble -> AD s TowerDouble
f(AD Any TowerDouble -> AD Any TowerDouble)
-> (TowerDouble -> AD Any TowerDouble)
-> TowerDouble
-> AD Any TowerDouble
forall b c a. (b -> c) -> (a -> b) -> a -> c
.TowerDouble -> AD Any TowerDouble
forall s a. a -> AD s a
AD)
{-# INLINE fixedPoint #-}
extremum :: (forall s. AD s (On (Forward TowerDouble)) -> AD s (On (Forward TowerDouble))) -> Double -> [Double]
extremum :: (forall s.
AD s (On (Forward TowerDouble)) -> AD s (On (Forward TowerDouble)))
-> Double -> [Double]
extremum forall s.
AD s (On (Forward TowerDouble)) -> AD s (On (Forward TowerDouble))
f = (On (Forward TowerDouble) -> On (Forward TowerDouble))
-> Double -> [Double]
Rank1.extremum (AD Any (On (Forward TowerDouble)) -> On (Forward TowerDouble)
forall s a. AD s a -> a
runAD(AD Any (On (Forward TowerDouble)) -> On (Forward TowerDouble))
-> (On (Forward TowerDouble) -> AD Any (On (Forward TowerDouble)))
-> On (Forward TowerDouble)
-> On (Forward TowerDouble)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.AD Any (On (Forward TowerDouble))
-> AD Any (On (Forward TowerDouble))
forall s.
AD s (On (Forward TowerDouble)) -> AD s (On (Forward TowerDouble))
f(AD Any (On (Forward TowerDouble))
-> AD Any (On (Forward TowerDouble)))
-> (On (Forward TowerDouble) -> AD Any (On (Forward TowerDouble)))
-> On (Forward TowerDouble)
-> AD Any (On (Forward TowerDouble))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.On (Forward TowerDouble) -> AD Any (On (Forward TowerDouble))
forall s a. a -> AD s a
AD)
{-# INLINE extremum #-}