-- GENERATED by C->Haskell Compiler, version 0.28.8 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./QuantLib/PricingEngine.chs" #-}
{-# LANGUAGE FlexibleInstances #-}
module QuantLib.PricingEngine
  (
    -- * Types
    -- ** Engines
    PricingEngine
  , FdmQuantoHelper

    -- ** Option calculators
  , GenBlackCalculator
  , BlackCalculator
  , BlackScholesCalculator
  , BachelierCalculator
  , BlackDeltaCalculator

    -- ** Configuration
  , CashAnnuityModel(..)
  , Probabilities(..)
  , CashDividendModel(..)
  , NumericalFix(..)
  , AccrualBias(..)
  , ForwardsInCouponPeriod(..)
  , SolverType(..)
  , FixedPointEquation(..)
  , QdFpScheme(..)
  , IntegrationControl(..)
  , LatticeTime(..)
  , FdmGrid(..)
  , OperatorSplittingOrder(..)
  , PerpetualFuturesInterpolationType(..)
  , StrikeSpec(..)

    -- * Constructors
    -- ** Discounting and counterparty engines
  , discountingBondEngine
  , riskyBondEngine
  , discountingSwapEngine
  , discountingFxForwardEngine
  , discountingConstNotionalCrossCurrencySwapEngine
  , counterpartyAdjSwapEngine
  , discountingPerpetualFuturesEngine

    -- ** Analytic, lattice and Monte Carlo engines
  , analyticBarrierEngine
  , analyticTwoAssetBarrierEngine
  , analyticSoftBarrierEngine
  , analyticPartialTimeBarrierOptionEngine
  , analyticBinaryBarrierEngine
  , analyticSimpleChooserEngine
  , analyticComplexChooserEngine
  , analyticTwoAssetCorrelationEngine
  , analyticEuropeanMargrabeEngine
  , analyticAmericanMargrabeEngine
  , analyticWriterExtensibleOptionEngine
  , analyticHolderExtensibleOptionEngine
  , fdBlackScholesBarrierEngine
  , fdHestonBarrierEngine
  , binomialBarrierEngine
  , vannaVolgaBarrierEngine
  , analyticDoubleBarrierEngine
  , fdHestonDoubleBarrierEngine
  , vannaVolgaDoubleBarrierEngine
  , binomialDoubleBarrierEngine
  , mcDoubleBarrierEngine
  , analyticCliquetEngine
  , analyticCompoundOptionEngine
  , analyticContinuousFixedLookbackEngine
  , analyticContinuousFloatingLookbackEngine
  , analyticContinuousPartialFloatingLookbackEngine
  , analyticContinuousPartialFixedLookbackEngine
  , analyticContinuousGeometricAveragePriceAsianEngine
  , analyticContinuousGeometricAveragePriceAsianHestonEngine
  , analyticDiscreteGeometricAveragePriceAsianHestonEngine
  , mcLookbackFixedEngine
  , mcLookbackFloatingEngine
  , mcLookbackPartialFixedEngine
  , mcLookbackPartialFloatingEngine
  , analyticDigitalAmericanEngine
  , analyticDigitalAmericanKoEngine
  , analyticDiscreteGeometricAveragePriceAsianEngine
  , analyticDiscreteGeometricAverageStrikeAsianEngine
  , turnbullWakemanAsianEngine
  , fdBlackScholesAsianEngine
  , analyticDividendEuropeanEngine
  , analyticEuropeanEngine
  , analyticPerformanceEngine
  , forwardEuropeanEngine
  , forwardBaroneAdesiWhaleyEngine
  , forwardBjerksundStenslandEngine
  , forwardFdBlackScholesVanillaEngine
  , mcForwardEuropeanBsEngine
  , mcForwardEuropeanHestonEngine
  , analyticHestonForwardEuropeanEngine
  , quantoEuropeanEngine
  , quantoForwardEuropeanEngine
  , quantoForwardPerformanceEuropeanEngine
  , quantoBarrierEngine
  , quantoDoubleBarrierEngine
    -- ** Rates and inflation
  , blackCapFloorEngineFromVolatilityStructure
  , blackCapFloorEngine
  , blackSwaptionEngine
  , haganIrregularSwaptionEngine
  , blackSwaptionEngineFromVolatilityStructure
  , bachelierCapFloorEngineFromVolatilityStructure
  , bachelierCapFloorEngine
  , yoyInflationBlackCapFloorEngine
  , yoyInflationUnitDisplacedBlackCapFloorEngine
  , yoyInflationBachelierCapFloorEngine
  , interpolatingCpiCapFloorEngine
  , bachelierSwaptionEngine
  , bachelierSwaptionEngineFromVolatilityStructure
  , analyticBsmHullWhiteEngine
  , analyticCapFloorEngine
  , gaussian1dCapFloorEngine
    -- ** Equity, stochastic-volatility and exotic products
  , analyticGjrGarchEngine
  , analyticHestonEngine
  , analyticHestonHullWhiteEngine
  , batesEngine
  , fftVanillaEngine
  , g2SwaptionEngine
  , jumpDiffusionEngine
  , treeCapFloorEngine
  , treeSwaptionEngine
  , treeVanillaSwapEngine
  , varianceGammaEngine
  , analyticHestonEngineOptimalControlVariate
  , mcHestonHullWhiteEngine
  , mcAmericanEngine
  , mcBarrierEngine
  , mcDigitalEngine
  , mcDiscreteArithmeticApEngine
  , mcDiscreteArithmeticAsEngine
  , mcDiscreteGeometricApEngine
  , mcDiscreteArithmeticApHestonEngine
  , mcDiscreteGeometricApHestonEngine
  , mcEuropeanEngine
  , mcEuropeanGjrGarchEngine
  , mcEuropeanHestonEngine
  , integralHestonVarianceOptionEngine
  , mcHullWhiteCapFloorEngine
  , mcHimalayaEngine
  , mcPagodaEngine
  , mcEuropeanBasketEngine
  , mcEverestEngine
  , mcAmericanBasketEngine
  , mcPerformanceEngine
  , mcVarianceSwapEngine
  , baroneAdesiWhaleyApproximationEngine
  , batesDetJumpEngine
  , batesDoubleExpDetJumpEngine
  , batesDoubleExpEngine
  , bjerksundStenslandApproximationEngine
  , qdPlusAmericanEngine
  , qdFpAmericanEngine
  , continuousArithmeticAsianVecerEngine
    -- ** Credit and spread products
  , integralCdsEngine
  , integralEngine
  , isdaCdsEngine
  , jamshidianSwaptionEngine
  , gaussian1dSwaptionEngine
  , gaussian1dNonstandardSwaptionEngine
  , gaussian1dFloatFloatSwaptionEngine
  , gaussian1dJamshidianSwaptionEngine
  , juQuadraticApproximationEngine
  , kirkEngine
  , midPointCdsEngine
  , midPointCdoEngine
  , integralCdoEngine
  , integralNtdEngine
  , replicatingVarianceSwapEngine
  , stulzEngine
  , bjerksundStenslandSpreadEngine
  , operatorSplittingSpreadEngine
  , pearsonSpreadEngine
  , gaussianCopulaSpreadEngine
  , fd2dBlackScholesVanillaEngine
  , choiBasketEngine
  , dengLiZhouBasketEngine
  , fdndimBlackScholesVanillaEngine
  , singleFactorBsmBasketEngine
  , lfmSwaptionEngine

    -- ** Finite-difference engines
  , fdG2SwaptionEngine
  , fdHullWhiteSwaptionEngine
  , binomialVanillaEngine
  , fdBlackScholesVanillaEngine
  , fdBlackScholesVanillaEngineQuanto
  , fdmQuantoHelper
  , quantoAdjustment
  , fdHestonVanillaEngine
  , cosHestonEngine
  , analyticPdfHestonEngine
  , fdBatesVanillaEngine
  , fdBlackScholesShoutEngine
  , fdHestonVanillaEngineQuanto
  , fdHestonHullWhiteVanillaEngine

    -- ** Convertible and callable bond engines
  , binomialConvertibleEngine
  , blackCallableFixedRateBondEngineFromVolatilityStructure
  , blackCallableFixedRateBondEngine
  , blackCallableZeroCouponBondEngineFromVolatilityStructure
  , blackCallableZeroCouponBondEngine
  , treeCallableFixedRateBondEngine
  , treeCallableZeroCouponBondEngine

    -- ** Black and Bachelier calculators
  , asBlackCalculator
  , blackCalculator
  , blackScholesCalculator
  , bachelierCalculator
  , blackDeltaCalculator

    -- * Inspectors
    -- ** Option-calculator capability
  , HasOptionCalculator(..)

    -- ** Calculator sensitivities
  , blackVanna
  , blackScholesDelta
  , blackScholesElasticity
  , blackScholesGamma
  , blackScholesTheta
  , blackScholesThetaPerDay
  , bachelierVanna

    -- ** Formulae, probabilities and SABR helpers
  , deltaFromStrike
  , strikeFromDelta
  , atmStrike
  , blackFormula
  , blackCashItmProbability
  , blackImpliedStdDev
  , blackImpliedStdDevApproximation
  , blackStdDevDerivative
  , blackVolDerivative
  , bachelierBlackFormula
  , blackForwardDerivative
  , blackImpliedStdDevChambers
  , blackImpliedStdDevApproximationRs
  , blackImpliedStdDevLiRs
  , blackAssetItmProbability
  , blackStdDevSecondDerivative
  , bachelierForwardDerivative
  , bachelierImpliedVol
  , bachelierImpliedVolChoi
  , bachelierStdDevDerivative
  , bachelierAssetItmProbability
  , defaultThetaPerDay
  , unsafeSabrLogNormalVolatility
  , unsafeShiftedSabrVolatility
  , unsafeSabrNormalVolatility
  , unsafeSabrVolatility
  , sabrVolatility
  , shiftedSabrVolatility
  , sabrFlochKennedyVolatility
  , validateSabrParameters
  , sabrGuess
  ) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import qualified System.IO.Unsafe as C2HSImp








import QuantLib.Internal
import QuantLib.Internal.Type
import QuantLib.InterestRate(VolatilityType)
import QuantLib.Math
{-# LINE 273 "./QuantLib/PricingEngine.chs" #-}

import QuantLib.Quote(DeltaType, AtmType)
import QuantLib.Instrument.Option hiding(itmCashProbability, deltaForward, strikeSensitivity, dividendRho, rho, vega)
import QuantLib.Internal.Common
import Data.List.NonEmpty(NonEmpty, toList)

data CashAnnuityModel = SwapRate
                      | DiscountCurve
  deriving (Enum,Show,Eq,Read)

{-# LINE 279 "./QuantLib/PricingEngine.chs" #-}


-- |Numerical integration control for analytic Heston-family engines.
data IntegrationControl
  = IntegrationOrder Word
  | IntegrationTolerance Double Word
  deriving (Eq, Show)

-- |An option's type and strike, given directly or carried by a striked payoff.
data StrikeSpec
  = Strike !OptionType !Double
  | StrikePayoff !StrikedPayoff

-- |Time discretization for lattice pricing engines.
data LatticeTime
  = TimeSteps Word
  | ExplicitTimeGrid TimeGrid

-- |Spatial discretization for an n-dimensional finite-difference engine.
data FdmGrid
  = UniformGrid Word
  | AxisGrids (NonEmpty Word)
  deriving (FdmGrid -> FdmGrid -> Bool
(FdmGrid -> FdmGrid -> Bool)
-> (FdmGrid -> FdmGrid -> Bool) -> Eq FdmGrid
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FdmGrid -> FdmGrid -> Bool
== :: FdmGrid -> FdmGrid -> Bool
$c/= :: FdmGrid -> FdmGrid -> Bool
/= :: FdmGrid -> FdmGrid -> Bool
Eq, Int -> FdmGrid -> ShowS
[FdmGrid] -> ShowS
FdmGrid -> String
(Int -> FdmGrid -> ShowS)
-> (FdmGrid -> String) -> ([FdmGrid] -> ShowS) -> Show FdmGrid
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FdmGrid -> ShowS
showsPrec :: Int -> FdmGrid -> ShowS
$cshow :: FdmGrid -> String
show :: FdmGrid -> String
$cshowList :: [FdmGrid] -> ShowS
showList :: [FdmGrid] -> ShowS
Show)
data Probabilities = None
                   | Naive
                   | Digital
  deriving (Enum,Show,Eq,Read)

{-# LINE 302 "./QuantLib/PricingEngine.chs" #-}

data CashDividendModel = CashDividendSpot
                       | CashDividendEscrowed
  deriving (Enum,Show,Eq,Read)

{-# LINE 303 "./QuantLib/PricingEngine.chs" #-}

data NumericalFix = NumericalFixNone
                  | NumericalFixTaylor
  deriving (Enum,Show,Eq,Read)

{-# LINE 304 "./QuantLib/PricingEngine.chs" #-}

data AccrualBias = HalfDayBias
                 | NoBias
  deriving (Enum,Show,Eq,Read)

{-# LINE 305 "./QuantLib/PricingEngine.chs" #-}

data ForwardsInCouponPeriod = Flat
                            | Piecewise
  deriving (Enum,Show,Eq,Read)

{-# LINE 306 "./QuantLib/PricingEngine.chs" #-}

data SolverType = Brent
                | Newton
                | Ridder
                | Halley
                | SuperHalley
  deriving (Int -> OperatorSplittingOrder
Int -> SolverType
Int -> QdFpScheme -> ShowS
[QdFpScheme] -> ShowS
OperatorSplittingOrder -> Int
OperatorSplittingOrder -> [OperatorSplittingOrder]
OperatorSplittingOrder -> OperatorSplittingOrder
OperatorSplittingOrder
-> OperatorSplittingOrder -> [OperatorSplittingOrder]
OperatorSplittingOrder
-> OperatorSplittingOrder
-> OperatorSplittingOrder
-> [OperatorSplittingOrder]
QdFpScheme -> String
SolverType -> Int
SolverType -> [SolverType]
SolverType -> SolverType
SolverType -> SolverType -> [SolverType]
SolverType -> SolverType -> SolverType -> [SolverType]
(Int -> QdFpScheme -> ShowS)
-> (QdFpScheme -> String)
-> ([QdFpScheme] -> ShowS)
-> Show QdFpScheme
(OperatorSplittingOrder -> OperatorSplittingOrder)
-> (OperatorSplittingOrder -> OperatorSplittingOrder)
-> (Int -> OperatorSplittingOrder)
-> (OperatorSplittingOrder -> Int)
-> (OperatorSplittingOrder -> [OperatorSplittingOrder])
-> (OperatorSplittingOrder
    -> OperatorSplittingOrder -> [OperatorSplittingOrder])
-> (OperatorSplittingOrder
    -> OperatorSplittingOrder -> [OperatorSplittingOrder])
-> (OperatorSplittingOrder
    -> OperatorSplittingOrder
    -> OperatorSplittingOrder
    -> [OperatorSplittingOrder])
-> Enum OperatorSplittingOrder
(SolverType -> SolverType)
-> (SolverType -> SolverType)
-> (Int -> SolverType)
-> (SolverType -> Int)
-> (SolverType -> [SolverType])
-> (SolverType -> SolverType -> [SolverType])
-> (SolverType -> SolverType -> [SolverType])
-> (SolverType -> SolverType -> SolverType -> [SolverType])
-> Enum SolverType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$csucc :: OperatorSplittingOrder -> OperatorSplittingOrder
succ :: OperatorSplittingOrder -> OperatorSplittingOrder
$cpred :: OperatorSplittingOrder -> OperatorSplittingOrder
pred :: OperatorSplittingOrder -> OperatorSplittingOrder
$ctoEnum :: Int -> OperatorSplittingOrder
toEnum :: Int -> OperatorSplittingOrder
$cfromEnum :: OperatorSplittingOrder -> Int
fromEnum :: OperatorSplittingOrder -> Int
$cenumFrom :: OperatorSplittingOrder -> [OperatorSplittingOrder]
enumFrom :: OperatorSplittingOrder -> [OperatorSplittingOrder]
$cenumFromThen :: OperatorSplittingOrder
-> OperatorSplittingOrder -> [OperatorSplittingOrder]
enumFromThen :: OperatorSplittingOrder
-> OperatorSplittingOrder -> [OperatorSplittingOrder]
$cenumFromTo :: OperatorSplittingOrder
-> OperatorSplittingOrder -> [OperatorSplittingOrder]
enumFromTo :: OperatorSplittingOrder
-> OperatorSplittingOrder -> [OperatorSplittingOrder]
$cenumFromThenTo :: OperatorSplittingOrder
-> OperatorSplittingOrder
-> OperatorSplittingOrder
-> [OperatorSplittingOrder]
enumFromThenTo :: OperatorSplittingOrder
-> OperatorSplittingOrder
-> OperatorSplittingOrder
-> [OperatorSplittingOrder]
$cshowsPrec :: Int -> QdFpScheme -> ShowS
showsPrec :: Int -> QdFpScheme -> ShowS
$cshow :: QdFpScheme -> String
show :: QdFpScheme -> String
$cshowList :: [QdFpScheme] -> ShowS
showList :: [QdFpScheme] -> ShowS
$csucc :: SolverType -> SolverType
succ :: SolverType -> SolverType
$cpred :: SolverType -> SolverType
pred :: SolverType -> SolverType
$ctoEnum :: Int -> SolverType
toEnum :: Int -> SolverType
$cfromEnum :: SolverType -> Int
fromEnum :: SolverType -> Int
$cenumFrom :: SolverType -> [SolverType]
enumFrom :: SolverType -> [SolverType]
$cenumFromThen :: SolverType -> SolverType -> [SolverType]
enumFromThen :: SolverType -> SolverType -> [SolverType]
$cenumFromTo :: SolverType -> SolverType -> [SolverType]
enumFromTo :: SolverType -> SolverType -> [SolverType]
$cenumFromThenTo :: SolverType -> SolverType -> SolverType -> [SolverType]
enumFromThenTo :: SolverType -> SolverType -> SolverType -> [SolverType]
Enum,Int -> OperatorSplittingOrder -> ShowS
Int -> SolverType -> ShowS
[OperatorSplittingOrder] -> ShowS
[SolverType] -> ShowS
OperatorSplittingOrder -> String
SolverType -> String
(Int -> OperatorSplittingOrder -> ShowS)
-> (OperatorSplittingOrder -> String)
-> ([OperatorSplittingOrder] -> ShowS)
-> Show OperatorSplittingOrder
(Int -> SolverType -> ShowS)
-> (SolverType -> String)
-> ([SolverType] -> ShowS)
-> Show SolverType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OperatorSplittingOrder -> ShowS
showsPrec :: Int -> OperatorSplittingOrder -> ShowS
$cshow :: OperatorSplittingOrder -> String
show :: OperatorSplittingOrder -> String
$cshowList :: [OperatorSplittingOrder] -> ShowS
showList :: [OperatorSplittingOrder] -> ShowS
$cshowsPrec :: Int -> SolverType -> ShowS
showsPrec :: Int -> SolverType -> ShowS
$cshow :: SolverType -> String
show :: SolverType -> String
$cshowList :: [SolverType] -> ShowS
showList :: [SolverType] -> ShowS
Show,Eq,ReadPrec [OperatorSplittingOrder]
ReadPrec [SolverType]
ReadPrec OperatorSplittingOrder
ReadPrec SolverType
Int -> ReadS OperatorSplittingOrder
Int -> ReadS SolverType
ReadS [OperatorSplittingOrder]
ReadS [SolverType]
(Int -> ReadS OperatorSplittingOrder)
-> ReadS [OperatorSplittingOrder]
-> ReadPrec OperatorSplittingOrder
-> ReadPrec [OperatorSplittingOrder]
-> Read OperatorSplittingOrder
(Int -> ReadS SolverType)
-> ReadS [SolverType]
-> ReadPrec SolverType
-> ReadPrec [SolverType]
-> Read SolverType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS OperatorSplittingOrder
readsPrec :: Int -> ReadS OperatorSplittingOrder
$creadList :: ReadS [OperatorSplittingOrder]
readList :: ReadS [OperatorSplittingOrder]
$creadPrec :: ReadPrec OperatorSplittingOrder
readPrec :: ReadPrec OperatorSplittingOrder
$creadListPrec :: ReadPrec [OperatorSplittingOrder]
readListPrec :: ReadPrec [OperatorSplittingOrder]
$creadsPrec :: Int -> ReadS SolverType
readsPrec :: Int -> ReadS SolverType
$creadList :: ReadS [SolverType]
readList :: ReadS [SolverType]
$creadPrec :: ReadPrec SolverType
readPrec :: ReadPrec SolverType
$creadListPrec :: ReadPrec [SolverType]
readListPrec :: ReadPrec [SolverType]
Read)

{-# LINE 307 "./QuantLib/PricingEngine.chs" #-}

data FixedPointEquation = FP_A
                        | FP_B
                        | Auto
  deriving (Enum,Show,Eq,Read)

{-# LINE 308 "./QuantLib/PricingEngine.chs" #-}

data QdFpScheme = FastScheme
                | AccurateScheme
                | HighPrecisionScheme
  deriving (Show,Eq,Read)
instance Enum QdFpScheme where
  succ FastScheme = AccurateScheme
  succ AccurateScheme = HighPrecisionScheme
  succ HighPrecisionScheme = error "QdFpScheme.succ: HighPrecisionScheme has no successor"

  pred AccurateScheme = FastScheme
  pred HighPrecisionScheme = AccurateScheme
  pred FastScheme = error "QdFpScheme.pred: FastScheme has no predecessor"

  enumFromTo from to = go from
    where
      end = fromEnum to
      go v = case compare (fromEnum v) end of
                 LT -> v : go (succ v)
                 EQ -> [v]
                 GT -> []

  enumFrom from = enumFromTo from HighPrecisionScheme

  fromEnum FastScheme = 0
  fromEnum AccurateScheme = 1
  fromEnum HighPrecisionScheme = 2

  toEnum 0 = FastScheme
  toEnum 1 = AccurateScheme
  toEnum 2 = HighPrecisionScheme
  toEnum unmatched = error ("QdFpScheme.toEnum: Cannot match " ++ show unmatched)

{-# LINE 309 "./QuantLib/PricingEngine.chs" #-}

data OperatorSplittingOrder = First
                            | Second
  deriving (Enum,Show,Eq,Read)

{-# LINE 310 "./QuantLib/PricingEngine.chs" #-}

data PerpetualFuturesInterpolationType = PerpetualFuturesPiecewiseConstant
                                       | PerpetualFuturesLinearInterpolation
                                       | PerpetualFuturesCubicSpline
  deriving (Show,Eq,Read)
instance Enum PerpetualFuturesInterpolationType where
  succ PerpetualFuturesPiecewiseConstant = PerpetualFuturesLinearInterpolation
  succ PerpetualFuturesLinearInterpolation = PerpetualFuturesCubicSpline
  succ PerpetualFuturesCubicSpline = error "PerpetualFuturesInterpolationType.succ: PerpetualFuturesCubicSpline has no successor"

  pred PerpetualFuturesLinearInterpolation = PerpetualFuturesPiecewiseConstant
  pred PerpetualFuturesCubicSpline = PerpetualFuturesLinearInterpolation
  pred PerpetualFuturesPiecewiseConstant = error "PerpetualFuturesInterpolationType.pred: PerpetualFuturesPiecewiseConstant has no predecessor"

  enumFromTo from to = go from
    where
      end = fromEnum to
      go v = case compare (fromEnum v) end of
                 LT -> v : go (succ v)
                 EQ -> [v]
                 GT -> []

  enumFrom from = enumFromTo from PerpetualFuturesCubicSpline

  fromEnum PerpetualFuturesPiecewiseConstant = 0
  fromEnum PerpetualFuturesLinearInterpolation = 1
  fromEnum PerpetualFuturesCubicSpline = 2

  toEnum 0 = PerpetualFuturesPiecewiseConstant
  toEnum 1 = PerpetualFuturesLinearInterpolation
  toEnum 2 = PerpetualFuturesCubicSpline
  toEnum unmatched = error ("PerpetualFuturesInterpolationType.toEnum: Cannot match " ++ show unmatched)

{-# LINE 311 "./QuantLib/PricingEngine.chs" #-}



{-# LINE 313 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 314 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 315 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 316 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 317 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 318 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 319 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 320 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 321 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 322 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 323 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 324 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 325 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 326 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 327 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 328 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 329 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 330 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 331 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 332 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 333 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 334 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 335 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 336 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 337 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 338 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 339 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 340 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 341 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 342 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 343 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 344 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 345 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 346 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 347 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 348 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 349 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 350 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 351 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 352 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 353 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 354 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 355 "./QuantLib/PricingEngine.chs" #-}


{-# LINE 356 "./QuantLib/PricingEngine.chs" #-}


-- |discounts a bond's cash flows off a yield term structure
discountingBondEngine :: (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
 -> IO ((PricingEngine))
discountingBondEngine :: forall y. GenYieldTermStructure y -> Maybe Bool -> IO PricingEngine
discountingBondEngine GenYieldTermStructure y
a1 Maybe Bool
a2 =
  GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a1 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' -> 
  let {a2' :: CInt
a2' = Maybe Bool -> CInt
fromMaybeBool Maybe Bool
a2} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a3' -> 
  Ptr CYieldTermStructure'
-> CInt -> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
discountingBondEngine'_ Ptr CYieldTermStructure'
a1' CInt
a2' Ptr (Ptr CChar)
a3' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a3'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 360 "./QuantLib/PricingEngine.chs" #-}


-- |Discounts perpetual-futures cashflows to the curves' reference date. The
-- three funding vectors must be non-empty and have identical lengths. The
-- engine supports only 'PerpetualFuturesLinear' and 'PerpetualFuturesInverse'
-- payoffs; QuantLib rejects a Quanto payoff at pricing time.
discountingPerpetualFuturesEngine
  :: GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenQuote q
  -> NonEmpty (Double, Double, Double) -- ^@(fundingTime, fundingRate, interestRateDiff)@
  -> PerpetualFuturesInterpolationType -> Double -> IO PricingEngine
discountingPerpetualFuturesEngine domestic foreignCurve spot funding interpolation maxT =
  qlDiscountingPerpetualFuturesEngine domestic foreignCurve spot times rates diffs interpolation maxT
  where (times, rates, diffs) = unzip3 (toList funding)

qlDiscountingPerpetualFuturesEngine :: (GenYieldTermStructure y1) -- ^domesticDiscountCurve
 -> (GenYieldTermStructure y2) -- ^foreignDiscountCurve
 -> (GenQuote q) -- ^assetSpot
 -> ([Double]) -- ^fundingTimes
 -> ([Double]) -- ^fundingRates
 -> ([Double]) -- ^interestRateDiffs
 -> (PerpetualFuturesInterpolationType) -- ^fundingInterpType
 -> (Double) -- ^maxT
 -> IO ((PricingEngine))
qlDiscountingPerpetualFuturesEngine :: forall y1 y2 q.
GenYieldTermStructure y1
-> GenYieldTermStructure y2
-> GenQuote q
-> [Double]
-> [Double]
-> [Double]
-> PerpetualFuturesInterpolationType
-> Double
-> IO PricingEngine
qlDiscountingPerpetualFuturesEngine GenYieldTermStructure y1
a1 GenYieldTermStructure y2
a2 GenQuote q
a3 [Double]
a4 [Double]
a5 [Double]
a6 PerpetualFuturesInterpolationType
a7 Double
a8 =
  GenYieldTermStructure y1
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y1
a1 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' -> 
  GenYieldTermStructure y2
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y2
a2 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' -> 
  GenQuote q -> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a3 ((Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a3' -> 
  [Double]
-> ((CUInt, Ptr CDouble) -> IO PricingEngine) -> IO PricingEngine
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a4 (((CUInt, Ptr CDouble) -> IO PricingEngine) -> IO PricingEngine)
-> ((CUInt, Ptr CDouble) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr CDouble
a4'2) -> 
  withDoubleArray a5 $ \(a5'1, a5'2) -> 
  withDoubleArray a6 $ \(a6'1, a6'2) -> 
  let {a7' = fromEnumC a7} in 
  let {a8' = realToFrac a8} in 
  preErrorCheck $ \a9' -> 
  qlDiscountingPerpetualFuturesEngine'_ a1' a2' a3' a4'1  a4'2 a5'1  a5'2 a6'1  a6'2 a7' a8' a9' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 383 "./QuantLib/PricingEngine.chs" #-}


-- |discounts a bond's cash flows off a default-risky curve and a flat recovery rate
riskyBondEngine :: (GenDefaultProbabilityTermStructure d) -> (Double) -- ^recoveryRate
 -> (GenYieldTermStructure y) -> IO ((PricingEngine))
riskyBondEngine a1 a2 a3 =
  withDefaultProbabilityTermStructure a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  withYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  riskyBondEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 388 "./QuantLib/PricingEngine.chs" #-}


-- |discounts a swap's legs off a single discount curve
discountingSwapEngine :: (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
 -> (Maybe Day) -- ^settlementDate
 -> (Maybe Day) -- ^npvDate
 -> IO ((PricingEngine))
discountingSwapEngine a1 a2 a3 a4 =
  withYieldTermStructure a1 $ \a1' -> 
  let {a2' = fromMaybeBool a2} in 
  withMaybeDay a3 $ \a3' -> 
  withMaybeDay a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  discountingSwapEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 394 "./QuantLib/PricingEngine.chs" #-}


-- |discounts an FX forward's two legs off their respective currency discount curves
discountingFxForwardEngine :: (GenYieldTermStructure y1) -- ^sourceCurrencyDiscountCurve
 -> (GenYieldTermStructure y2) -- ^targetCurrencyDiscountCurve
 -> (GenQuote q) -- ^spotFx
 -> IO ((PricingEngine))
discountingFxForwardEngine a1 a2 a3 =
  withYieldTermStructure a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  withQuote a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  discountingFxForwardEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 400 "./QuantLib/PricingEngine.chs" #-}


-- |Discounts each leg of a 'QuantLib.Instrument.Swap.ConstNotionalCrossCurrencySwap' (or either
-- of its two leaves) off its own currency's discount curve, converting to @domesticCcy@ via
-- @spotFX@ (quoted as units of @domesticCcy@ per unit of @foreignCcy@, w.r.t. a settlement equal
-- to the npv date unless @spotFXSettleDate@ says otherwise). Each leg's stored currency must equal
-- @domesticCcy@ or @foreignCcy@; the two discount curves must share the same reference date.
discountingConstNotionalCrossCurrencySwapEngine :: (Currency) -- ^domesticCcy
 -> (GenYieldTermStructure y1) -- ^domesticCcyDiscountCurve
 -> (Currency) -- ^foreignCcy
 -> (GenYieldTermStructure y2) -- ^foreignCcyDiscountCurve
 -> (GenQuote q) -- ^spotFX
 -> (Maybe Bool) -- ^includeSettlementDateFlows
 -> (Maybe Day) -- ^settlementDate
 -> (Maybe Day) -- ^npvDate
 -> (Maybe Day) -- ^spotFXSettleDate
 -> IO ((PricingEngine))
discountingConstNotionalCrossCurrencySwapEngine :: forall y1 y2 q.
Currency
-> GenYieldTermStructure y1
-> Currency
-> GenYieldTermStructure y2
-> GenQuote q
-> Maybe Bool
-> Maybe Day
-> Maybe Day
-> Maybe Day
-> IO PricingEngine
discountingConstNotionalCrossCurrencySwapEngine Currency
a1 GenYieldTermStructure y1
a2 Currency
a3 GenYieldTermStructure y2
a4 GenQuote q
a5 Maybe Bool
a6 Maybe Day
a7 Maybe Day
a8 Maybe Day
a9 =
  Currency -> (Ptr CCurrency -> IO PricingEngine) -> IO PricingEngine
forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency Currency
a1 ((Ptr CCurrency -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CCurrency -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CCurrency
a1' -> 
  GenYieldTermStructure y1
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y1
a2 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' -> 
  Currency -> (Ptr CCurrency -> IO PricingEngine) -> IO PricingEngine
forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency Currency
a3 ((Ptr CCurrency -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CCurrency -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CCurrency
a3' -> 
  GenYieldTermStructure y2
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y2
a4 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a4' -> 
  GenQuote q -> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a5 ((Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a5' -> 
  let {a6' :: CInt
a6' = Maybe Bool -> CInt
fromMaybeBool Maybe Bool
a6} in 
  Maybe Day -> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a7 ((CInt -> IO PricingEngine) -> IO PricingEngine)
-> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \CInt
a7' -> 
  Maybe Day -> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a8 ((CInt -> IO PricingEngine) -> IO PricingEngine)
-> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \CInt
a8' -> 
  Maybe Day -> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a9 ((CInt -> IO PricingEngine) -> IO PricingEngine)
-> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \CInt
a9' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' -> 
  Ptr CCurrency
-> Ptr CYieldTermStructure'
-> Ptr CCurrency
-> Ptr CYieldTermStructure'
-> Ptr CQuote'
-> CInt
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
discountingConstNotionalCrossCurrencySwapEngine'_ Ptr CCurrency
a1' Ptr CYieldTermStructure'
a2' Ptr CCurrency
a3' Ptr CYieldTermStructure'
a4' Ptr CQuote'
a5' CInt
a6' CInt
a7' CInt
a8' CInt
a9' Ptr (Ptr CChar)
a10' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a10'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 416 "./QuantLib/PricingEngine.chs" #-}


-- | CVA/DVA-adjusted swap pricing engine. @invstDTS@\/@invstRecoveryRate@ are the
-- own (investor-side) default probability curve and recovery rate for bilateral
-- CVA\/DVA; pass 'Nothing' for @invstDTS@ and @0.999@ for @invstRecoveryRate@ to
-- match upstream's unilateral-CVA-only defaults.
counterpartyAdjSwapEngine :: (GenYieldTermStructure y) -- ^discountCurve
 -> (GenQuote q) -- ^blackVol
 -> (GenDefaultProbabilityTermStructure d1) -- ^ctptyDTS
 -> (Double) -- ^ctptyRecoveryRate
 -> (Maybe (GenDefaultProbabilityTermStructure d2)) -- ^invstDTS
 -> (Double) -- ^invstRecoveryRate
 -> IO ((PricingEngine))
counterpartyAdjSwapEngine a1 a2 a3 a4 a5 a6 =
  withYieldTermStructure a1 $ \a1' -> 
  withQuote a2 $ \a2' -> 
  withDefaultProbabilityTermStructure a3 $ \a3' -> 
  let {a4' = realToFrac a4} in 
  withMaybeDefaultProbabilityTermStructure a5 $ \a5' -> 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  counterpartyAdjSwapEngine'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 428 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for barrier options
analyticBarrierEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticBarrierEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticBarrierEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 431 "./QuantLib/PricingEngine.chs" #-}


-- |analytic (Heynen and Kat) pricing engine for a barrier option on two assets, where the first asset's value is compared to the strike and the second's is monitored against the barrier
analyticTwoAssetBarrierEngine :: (GeneralizedBlackScholesProcess) -- ^process1
 -> (GeneralizedBlackScholesProcess) -- ^process2
 -> (GenQuote q) -- ^rho
 -> IO ((PricingEngine))
analyticTwoAssetBarrierEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  withQuote a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  analyticTwoAssetBarrierEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 437 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for soft barrier options, knocked in/out proportionally over a barrier range
analyticSoftBarrierEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticSoftBarrierEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticSoftBarrierEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 440 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for simple chooser options
analyticSimpleChooserEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticSimpleChooserEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticSimpleChooserEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 443 "./QuantLib/PricingEngine.chs" #-}


-- |Analytic Black-Scholes engine for a 'complexChooserOption'. Both alternatives must have European exercise.
analyticComplexChooserEngine :: (GeneralizedBlackScholesProcess) -- ^process
 -> IO ((PricingEngine))
analyticComplexChooserEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticComplexChooserEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 447 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for two-asset correlation options
analyticTwoAssetCorrelationEngine :: (GeneralizedBlackScholesProcess) -- ^process1
 -> (GeneralizedBlackScholesProcess) -- ^process2
 -> (GenQuote q) -- ^correlation
 -> IO ((PricingEngine))
analyticTwoAssetCorrelationEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  withQuote a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  analyticTwoAssetCorrelationEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 453 "./QuantLib/PricingEngine.chs" #-}


-- |Analytic (Margrabe) engine for a European 'margrabeOption': the closed-form price of an
-- option to exchange one asset for another, from W. Margrabe, \"The Value of an Option to
-- Exchange One Asset for Another\", Journal of Finance 33 (March 1978), 177-186.
analyticEuropeanMargrabeEngine :: (GeneralizedBlackScholesProcess) -- ^process1
 -> (GeneralizedBlackScholesProcess) -- ^process2
 -> (Double) -- ^correlation
 -> IO ((PricingEngine))
analyticEuropeanMargrabeEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  analyticEuropeanMargrabeEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 461 "./QuantLib/PricingEngine.chs" #-}


-- |Analytic (Margrabe) engine for an American 'margrabeOption': the closed-form price of an
-- option to exchange one asset for another with early exercise, from W. Margrabe, \"The Value
-- of an American Option to Exchange One Asset for Another\", Journal of Finance 33, 177-86.
analyticAmericanMargrabeEngine :: (GeneralizedBlackScholesProcess) -- ^process1
 -> (GeneralizedBlackScholesProcess) -- ^process2
 -> (Double) -- ^correlation
 -> IO ((PricingEngine))
analyticAmericanMargrabeEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  analyticAmericanMargrabeEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 469 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for writer-extensible options
analyticWriterExtensibleOptionEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticWriterExtensibleOptionEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticWriterExtensibleOptionEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 472 "./QuantLib/PricingEngine.chs" #-}


-- |Analytic Black-Scholes engine for a 'holderExtensibleOption'. The original option must have European exercise.
analyticHolderExtensibleOptionEngine :: (GeneralizedBlackScholesProcess) -- ^process
 -> IO ((PricingEngine))
analyticHolderExtensibleOptionEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticHolderExtensibleOptionEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 476 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for partial-time barrier options
analyticPartialTimeBarrierOptionEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticPartialTimeBarrierOptionEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticPartialTimeBarrierOptionEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 479 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for American binary barrier options (cash-or-nothing/asset-or-nothing)
analyticBinaryBarrierEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticBinaryBarrierEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticBinaryBarrierEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 482 "./QuantLib/PricingEngine.chs" #-}


-- |/NB/ Timesteps for Cox-Ross-Rubinstein trees are adjusted using the Boyle-Lau algorithm;
-- pass @maxTimeSteps = timeSteps@ to disable it, or @0@ to use the library's default heuristic.
binomialBarrierEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 -> (Word) -- ^maxTimeSteps
 -> IO ((PricingEngine))
binomialBarrierEngine a1 a2 a3 a4 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  preErrorCheck $ \a5' -> 
  binomialBarrierEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 488 "./QuantLib/PricingEngine.chs" #-}


-- |FX barrier option engine using the vanna-volga method to account for the volatility smile
vannaVolgaBarrierEngine :: (DeltaVolQuote) -- ^atmVol
 -> (DeltaVolQuote) -- ^vol25Put
 -> (DeltaVolQuote) -- ^vol25Call
 -> (GenQuote q) -- ^spotFX
 -> (GenYieldTermStructure y1) -- ^domesticTS
 -> (GenYieldTermStructure y2) -- ^foreignTS
 -> (Bool) -- ^adaptVanDelta
 -> (Double) -- ^bsPriceWithSmile
 -> IO ((PricingEngine))
vannaVolgaBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 =
  withGenQuote a1 $ \a1' -> 
  withGenQuote a2 $ \a2' -> 
  withGenQuote a3 $ \a3' -> 
  withQuote a4 $ \a4' -> 
  withYieldTermStructure a5 $ \a5' -> 
  withYieldTermStructure a6 $ \a6' -> 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = realToFrac a8} in 
  preErrorCheck $ \a9' -> 
  vannaVolgaBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 499 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for double-barrier European options
analyticDoubleBarrierEngine :: (GeneralizedBlackScholesProcess) -> (Int) -- ^series
 -> IO ((PricingEngine))
analyticDoubleBarrierEngine a1 a2 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  analyticDoubleBarrierEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 503 "./QuantLib/PricingEngine.chs" #-}


-- |always uses 'AnalyticDoubleBarrierEngine' as the underlying smile-free double-barrier engine
vannaVolgaDoubleBarrierEngine :: (DeltaVolQuote) -- ^atmVol
 -> (DeltaVolQuote) -- ^vol25Put
 -> (DeltaVolQuote) -- ^vol25Call
 -> (GenQuote q) -- ^spotFX
 -> (GenYieldTermStructure y1) -- ^domesticTS
 -> (GenYieldTermStructure y2) -- ^foreignTS
 -> (Bool) -- ^adaptVanDelta
 -> (Double) -- ^bsPriceWithSmile
 -> (Int) -- ^series
 -> IO ((PricingEngine))
vannaVolgaDoubleBarrierEngine :: forall q y1 y2.
DeltaVolQuote
-> DeltaVolQuote
-> DeltaVolQuote
-> GenQuote q
-> GenYieldTermStructure y1
-> GenYieldTermStructure y2
-> Bool
-> Double
-> Int
-> IO PricingEngine
vannaVolgaDoubleBarrierEngine DeltaVolQuote
a1 DeltaVolQuote
a2 DeltaVolQuote
a3 GenQuote q
a4 GenYieldTermStructure y1
a5 GenYieldTermStructure y2
a6 Bool
a7 Double
a8 Int
a9 =
  DeltaVolQuote
-> (Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. GenQuote (ForeignPtr q) -> (Ptr q -> IO b) -> IO b
withGenQuote DeltaVolQuote
a1 ((Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CDeltaVolQuote'
a1' -> 
  DeltaVolQuote
-> (Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. GenQuote (ForeignPtr q) -> (Ptr q -> IO b) -> IO b
withGenQuote DeltaVolQuote
a2 ((Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CDeltaVolQuote'
a2' -> 
  DeltaVolQuote
-> (Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. GenQuote (ForeignPtr q) -> (Ptr q -> IO b) -> IO b
withGenQuote DeltaVolQuote
a3 ((Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CDeltaVolQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CDeltaVolQuote'
a3' -> 
  GenQuote q -> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a4 ((Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a4' -> 
  GenYieldTermStructure y1
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y1
a5 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a5' -> 
  GenYieldTermStructure y2
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y2
a6 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a6' -> 
  let {a7' :: CInt
a7' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a7} in 
  let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in 
  let {a9' :: CInt
a9' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a9} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' -> 
  Ptr CDeltaVolQuote'
-> Ptr CDeltaVolQuote'
-> Ptr CDeltaVolQuote'
-> Ptr CQuote'
-> Ptr CYieldTermStructure'
-> Ptr CYieldTermStructure'
-> CInt
-> CDouble
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
vannaVolgaDoubleBarrierEngine'_ Ptr CDeltaVolQuote'
a1' Ptr CDeltaVolQuote'
a2' Ptr CDeltaVolQuote'
a3' a4' a5' a6' a7' a8' a9' a10' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 515 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for double-barrier options using binomial trees
binomialDoubleBarrierEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 -> IO ((PricingEngine))
binomialDoubleBarrierEngine a1 a2 a3 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  binomialDoubleBarrierEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 519 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for double-barrier options
mcDoubleBarrierEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcDoubleBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcDoubleBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 530 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for Cliquet (ratchet) options
analyticCliquetEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticCliquetEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticCliquetEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 533 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for compound options
analyticCompoundOptionEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticCompoundOptionEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticCompoundOptionEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 536 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European continuous fixed-strike lookback options
analyticContinuousFixedLookbackEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticContinuousFixedLookbackEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticContinuousFixedLookbackEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 539 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European continuous floating-strike lookback options
analyticContinuousFloatingLookbackEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticContinuousFloatingLookbackEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticContinuousFloatingLookbackEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 542 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European continuous partial-time floating-strike lookback options
analyticContinuousPartialFloatingLookbackEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticContinuousPartialFloatingLookbackEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticContinuousPartialFloatingLookbackEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 545 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European continuous partial-time fixed-strike lookback options
analyticContinuousPartialFixedLookbackEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticContinuousPartialFixedLookbackEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticContinuousPartialFixedLookbackEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 548 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European continuous geometric average-price Asian options
analyticContinuousGeometricAveragePriceAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticContinuousGeometricAveragePriceAsianEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticContinuousGeometricAveragePriceAsianEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 551 "./QuantLib/PricingEngine.chs" #-}


-- |Analytic pricing engine for European continuous geometric average-price Asian options under
-- the Heston stochastic-volatility model.  Implements the closed-form solution of Kim & Wee,
-- \"Pricing of geometric Asian options under Heston's stochastic volatility model\", Quantitative
-- Finance 14:10 (2014). /summationCutoff/ and /xiRightLimit/ bound the truncated summation and
-- integration ranges used by the closed form; QuantLib's own defaults are 50 and 100.0.
analyticContinuousGeometricAveragePriceAsianHestonEngine :: (GenHestonProcess hp) -> (Word) -- ^summationCutoff
 -> (Double) -- ^xiRightLimit
 -> IO ((PricingEngine))
analyticContinuousGeometricAveragePriceAsianHestonEngine :: forall hp.
GenHestonProcess hp -> Word -> Double -> IO PricingEngine
analyticContinuousGeometricAveragePriceAsianHestonEngine GenHestonProcess hp
a1 Word
a2 Double
a3 =
  GenHestonProcess hp
-> (Ptr CHestonProcess' -> IO PricingEngine) -> IO PricingEngine
forall hp b.
GenHestonProcess hp -> (Ptr CHestonProcess' -> IO b) -> IO b
withHestonProcess GenHestonProcess hp
a1 ((Ptr CHestonProcess' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHestonProcess' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonProcess'
a1' -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' -> 
  Ptr CHestonProcess'
-> CUInt -> CDouble -> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
analyticContinuousGeometricAveragePriceAsianHestonEngine'_ Ptr CHestonProcess'
a1' CUInt
a2' CDouble
a3' Ptr (Ptr CChar)
a4' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a4'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 561 "./QuantLib/PricingEngine.chs" #-}


-- |Analytic pricing engine for European discrete geometric average-price Asian options under the
-- Heston stochastic-volatility model.  Implements the closed-form solution of Kim, Kim, Kim & Wee,
-- \"A Recursive Method for Discretely Monitored Geometric Asian Option Prices\", Bull. Korean
-- Math. Soc. 53 (2016). /xiRightLimit/ bounds the truncated integration range; QuantLib's own
-- default is 100.0.
analyticDiscreteGeometricAveragePriceAsianHestonEngine :: (GenHestonProcess hp) -> (Double) -- ^xiRightLimit
 -> IO ((PricingEngine))
analyticDiscreteGeometricAveragePriceAsianHestonEngine a1 a2 =
  withHestonProcess a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  analyticDiscreteGeometricAveragePriceAsianHestonEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 570 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for continuous fixed-strike lookback options. Exactly one of
-- @timeSteps@\/@timeStepsPerYear@ must be given; the other must be 'Nothing'.
mcLookbackFixedEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcLookbackFixedEngine :: RngTrait
-> StatisticsTrait
-> GeneralizedBlackScholesProcess
-> Maybe Word
-> Maybe Word
-> Bool
-> Bool
-> Maybe Word
-> Maybe Double
-> Maybe Word
-> Word
-> IO PricingEngine
mcLookbackFixedEngine RngTrait
a1 StatisticsTrait
a2 GeneralizedBlackScholesProcess
a3 Maybe Word
a4 Maybe Word
a5 Bool
a6 Bool
a7 Maybe Word
a8 Maybe Double
a9 Maybe Word
a10 Word
a11 =
  let {a1' :: CInt
a1' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (RngTrait -> Int) -> RngTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RngTrait -> Int
forall a. Enum a => a -> Int
fromEnum) RngTrait
a1} in 
  let {a2' :: CInt
a2' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (StatisticsTrait -> Int) -> StatisticsTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StatisticsTrait -> Int
forall a. Enum a => a -> Int
fromEnum) StatisticsTrait
a2} in 
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a3 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a3' -> 
  let {a4' :: CUInt
a4' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a4} in 
  let {a5' :: CUInt
a5' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a5} in 
  let {a6' :: CInt
a6' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a6} in 
  let {a7' :: CInt
a7' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a7} in 
  let {a8' :: CUInt
a8' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a8} in 
  let {a9' :: CDouble
a9' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a9} in 
  let {a10' :: CUInt
a10' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a10} in 
  let {a11' :: CUInt
a11' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a11} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a12' -> 
  CInt
-> CInt
-> Ptr CGeneralizedBlackScholesProcess'
-> CUInt
-> CUInt
-> CInt
-> CInt
-> CUInt
-> CDouble
-> CUInt
-> CUInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
mcLookbackFixedEngine'_ CInt
a1' CInt
a2' Ptr CGeneralizedBlackScholesProcess'
a3' CUInt
a4' CUInt
a5' CInt
a6' CInt
a7' CUInt
a8' CDouble
a9' CUInt
a10' CUInt
a11' Ptr (Ptr CChar)
a12' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a12'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 582 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for continuous floating-strike lookback options. Exactly one of
-- @timeSteps@\/@timeStepsPerYear@ must be given; the other must be 'Nothing'.
mcLookbackFloatingEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcLookbackFloatingEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcLookbackFloatingEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 594 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for continuous partial-time fixed-strike lookback options. Exactly
-- one of @timeSteps@\/@timeStepsPerYear@ must be given; the other must be 'Nothing'.
mcLookbackPartialFixedEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcLookbackPartialFixedEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcLookbackPartialFixedEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 606 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for continuous partial-time floating-strike lookback options.
-- Exactly one of @timeSteps@\/@timeStepsPerYear@ must be given; the other must be 'Nothing'.
mcLookbackPartialFloatingEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcLookbackPartialFloatingEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcLookbackPartialFloatingEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 618 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for American digital (cash-or-nothing/asset-or-nothing) options
analyticDigitalAmericanEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticDigitalAmericanEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticDigitalAmericanEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 621 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for American knock-out digital (cash-or-nothing/asset-or-nothing) options
analyticDigitalAmericanKoEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticDigitalAmericanKoEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticDigitalAmericanKoEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 624 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European discrete geometric average-price Asian options
analyticDiscreteGeometricAveragePriceAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticDiscreteGeometricAveragePriceAsianEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticDiscreteGeometricAveragePriceAsianEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 627 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European discrete geometric average-strike Asian options
analyticDiscreteGeometricAverageStrikeAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticDiscreteGeometricAverageStrikeAsianEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticDiscreteGeometricAverageStrikeAsianEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 630 "./QuantLib/PricingEngine.chs" #-}


-- |Turnbull-Wakeman moment-matching pricing engine for discrete arithmetic average-price\/-strike Asian options
turnbullWakemanAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
turnbullWakemanAsianEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  turnbullWakemanAsianEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 633 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for European options with discrete dividends
analyticDividendEuropeanEngine :: (GeneralizedBlackScholesProcess) -> ([Dividend]) -> IO ((PricingEngine))
analyticDividendEuropeanEngine a1 a2 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  preErrorCheck $ \a3' -> 
  analyticDividendEuropeanEngine'_ a1' a2'1  a2'2 a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 636 "./QuantLib/PricingEngine.chs" #-}


-- |analytic Black-Scholes pricing engine for European options
analyticEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 -> IO ((PricingEngine))
analyticEuropeanEngine a1 a2 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withMaybeYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  analyticEuropeanEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 641 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for performance (return) options
analyticPerformanceEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
analyticPerformanceEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticPerformanceEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 644 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for forward-starting European options; binds the @AnalyticEuropeanEngine@ instantiation of upstream's @ForwardVanillaEngine\<Engine\>@ template
forwardEuropeanEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
forwardEuropeanEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardEuropeanEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 647 "./QuantLib/PricingEngine.chs" #-}


-- |Barone-Adesi\/Whaley approximation pricing engine for forward-starting American options; binds the @BaroneAdesiWhaleyApproximationEngine@ instantiation of @ForwardVanillaEngine\<Engine\>@
forwardBaroneAdesiWhaleyEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
forwardBaroneAdesiWhaleyEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardBaroneAdesiWhaleyEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 650 "./QuantLib/PricingEngine.chs" #-}


-- |Bjerksund\/Stensland approximation pricing engine for forward-starting American options; binds the @BjerksundStenslandApproximationEngine@ instantiation of @ForwardVanillaEngine\<Engine\>@
forwardBjerksundStenslandEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
forwardBjerksundStenslandEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardBjerksundStenslandEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 653 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Black-Scholes pricing engine for forward-starting vanilla options, with the wrapped engine's grid\/scheme params fixed at their QuantLib defaults; binds the @FdBlackScholesVanillaEngine@ instantiation of @ForwardVanillaEngine\<Engine\>@
forwardFdBlackScholesVanillaEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
forwardFdBlackScholesVanillaEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardFdBlackScholesVanillaEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 656 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for forward-starting European options under a Black-Scholes process
mcForwardEuropeanBsEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcForwardEuropeanBsEngine :: RngTrait
-> StatisticsTrait
-> GeneralizedBlackScholesProcess
-> Maybe Word
-> Maybe Word
-> Bool
-> Bool
-> Maybe Word
-> Maybe Double
-> Maybe Word
-> Word
-> IO PricingEngine
mcForwardEuropeanBsEngine RngTrait
a1 StatisticsTrait
a2 GeneralizedBlackScholesProcess
a3 Maybe Word
a4 Maybe Word
a5 Bool
a6 Bool
a7 Maybe Word
a8 Maybe Double
a9 Maybe Word
a10 Word
a11 =
  let {a1' :: CInt
a1' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (RngTrait -> Int) -> RngTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RngTrait -> Int
forall a. Enum a => a -> Int
fromEnum) RngTrait
a1} in 
  let {a2' :: CInt
a2' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (StatisticsTrait -> Int) -> StatisticsTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StatisticsTrait -> Int
forall a. Enum a => a -> Int
fromEnum) StatisticsTrait
a2} in 
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a3 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a3' -> 
  let {a4' :: CUInt
a4' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a4} in 
  let {a5' :: CUInt
a5' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a5} in 
  let {a6' :: CInt
a6' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a6} in 
  let {a7' :: CInt
a7' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a7} in 
  let {a8' :: CUInt
a8' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a8} in 
  let {a9' :: CDouble
a9' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a9} in 
  let {a10' :: CUInt
a10' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a10} in 
  let {a11' :: CUInt
a11' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a11} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a12' -> 
  CInt
-> CInt
-> Ptr CGeneralizedBlackScholesProcess'
-> CUInt
-> CUInt
-> CInt
-> CInt
-> CUInt
-> CDouble
-> CUInt
-> CUInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
mcForwardEuropeanBsEngine'_ CInt
a1' CInt
a2' Ptr CGeneralizedBlackScholesProcess'
a3' CUInt
a4' CUInt
a5' CInt
a6' CInt
a7' CUInt
a8' CDouble
a9' CUInt
a10' CUInt
a11' Ptr (Ptr CChar)
a12' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a12'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 667 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo engine for European 'forwardVanillaOption's under a Heston process. Supply either @requiredSamples@ or @requiredTolerance@, and use a fixed nonzero @seed@ for reproducible results.
mcForwardEuropeanHestonEngine :: (RngTrait) -- ^rng
 -> (StatisticsTrait) -- ^statistics
 -> (GenHestonProcess hp) -- ^process
 -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> (Bool) -- ^controlVariate
 -> IO ((PricingEngine))
mcForwardEuropeanHestonEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withHestonProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = fromMaybeInt a7} in 
  let {a8' = fromMaybeDouble a8} in 
  let {a9' = fromMaybeInt a9} in 
  let {a10' = fromIntegral a10} in 
  let {a11' = C2HSImp.fromBool a11} in 
  preErrorCheck $ \a12' -> 
  mcForwardEuropeanHestonEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 681 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for forward-starting European options under a Heston process
analyticHestonForwardEuropeanEngine :: (GenHestonProcess hp) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
analyticHestonForwardEuropeanEngine a1 a2 =
  withHestonProcess a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  analyticHestonForwardEuropeanEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 685 "./QuantLib/PricingEngine.chs" #-}


-- |quanto-adjusts a European vanilla option's price and greeks for a payoff paid in a currency other than the underlying's; binds the @VanillaOption@\/@AnalyticEuropeanEngine@ instantiation of upstream's @QuantoEngine\<Instr,Engine\>@ template
quantoEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 -> (GenQuote q) -- ^correlation
 -> IO ((PricingEngine))
quantoEuropeanEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  withBlackVolTermStructure a3 $ \a3' -> 
  withQuote a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  quantoEuropeanEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 692 "./QuantLib/PricingEngine.chs" #-}


-- |quanto-adjusts a forward-starting vanilla option; binds the @ForwardVanillaOption@\/@ForwardVanillaEngine\<AnalyticEuropeanEngine\>@ instantiation of @QuantoEngine\<Instr,Engine\>@
quantoForwardEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 -> (GenQuote q) -- ^correlation
 -> IO ((PricingEngine))
quantoForwardEuropeanEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  withBlackVolTermStructure a3 $ \a3' -> 
  withQuote a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  quantoForwardEuropeanEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 699 "./QuantLib/PricingEngine.chs" #-}


-- |quanto-adjusts a forward-starting performance (strike-resetting, percentage-payoff) vanilla option; binds the @ForwardVanillaOption@\/@ForwardPerformanceVanillaEngine\<AnalyticEuropeanEngine\>@ instantiation of @QuantoEngine\<Instr,Engine\>@
quantoForwardPerformanceEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 -> (GenQuote q) -- ^correlation
 -> IO ((PricingEngine))
quantoForwardPerformanceEuropeanEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  withBlackVolTermStructure a3 $ \a3' -> 
  withQuote a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  quantoForwardPerformanceEuropeanEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 706 "./QuantLib/PricingEngine.chs" #-}


-- |quanto-adjusts a single-barrier option; binds the @BarrierOption@\/@AnalyticBarrierEngine@ instantiation of @QuantoEngine\<Instr,Engine\>@
quantoBarrierEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 -> (GenQuote q) -- ^correlation
 -> IO ((PricingEngine))
quantoBarrierEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  withBlackVolTermStructure a3 $ \a3' -> 
  withQuote a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  quantoBarrierEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 713 "./QuantLib/PricingEngine.chs" #-}


-- |quanto-adjusts a double-barrier option; binds the @DoubleBarrierOption@\/@AnalyticDoubleBarrierEngine@ instantiation of @QuantoEngine\<Instr,Engine\>@
quantoDoubleBarrierEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 -> (GenQuote q) -- ^correlation
 -> IO ((PricingEngine))
quantoDoubleBarrierEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  withBlackVolTermStructure a3 $ \a3' -> 
  withQuote a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  quantoDoubleBarrierEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 720 "./QuantLib/PricingEngine.chs" #-}


-- |Black-formula cap\/floor engine, taking an optionlet volatility structure
blackCapFloorEngineFromVolatilityStructure :: (GenYieldTermStructure y) -> (GenOptionletVolatilityStructure ov) -> IO ((PricingEngine))
blackCapFloorEngineFromVolatilityStructure a1 a2 =
  withYieldTermStructure a1 $ \a1' -> 
  withOptionletVolatilityStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  blackCapFloorEngineFromVolatilityStructure'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 723 "./QuantLib/PricingEngine.chs" #-}


-- |Black-formula cap\/floor engine, taking a flat volatility quote
blackCapFloorEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> (Double) -- ^displacement
 -> IO ((PricingEngine))
blackCapFloorEngine a1 a2 a3 a4 =
  withYieldTermStructure a1 $ \a1' -> 
  withQuote a2 $ \a2' -> 
  withDayCounter a3 $ \a3' -> 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  blackCapFloorEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 728 "./QuantLib/PricingEngine.chs" #-}


-- |shifted-lognormal Black-formula swaption engine, taking a flat volatility quote
blackSwaptionEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> (Double) -- ^displacement
 -> (CashAnnuityModel) -- ^model
 -> IO ((PricingEngine))
blackSwaptionEngine a1 a2 a3 a4 a5 =
  withYieldTermStructure a1 $ \a1' -> 
  withQuote a2 $ \a2' -> 
  withDayCounter a3 $ \a3' -> 
  let {a4' = realToFrac a4} in 
  let {a5' = (fromIntegral . fromEnum) a5} in 
  preErrorCheck $ \a6' -> 
  blackSwaptionEngine'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 734 "./QuantLib/PricingEngine.chs" #-}

haganIrregularSwaptionEngine :: (GenSwaptionVolatilityStructure sv) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
haganIrregularSwaptionEngine a1 a2 =
  withSwaptionVolatilityStructure a1 $ \a1' -> 
  withMaybeYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  haganIrregularSwaptionEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 735 "./QuantLib/PricingEngine.chs" #-}


-- |shifted-lognormal Black-formula swaption engine, taking a swaption volatility structure
blackSwaptionEngineFromVolatilityStructure :: (GenYieldTermStructure y) -> (GenSwaptionVolatilityStructure sv) -> IO ((PricingEngine))
blackSwaptionEngineFromVolatilityStructure a1 a2 =
  withYieldTermStructure a1 $ \a1' -> 
  withSwaptionVolatilityStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  blackSwaptionEngineFromVolatilityStructure'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 738 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier (normal) cap\/floor engine, taking an optionlet volatility structure
bachelierCapFloorEngineFromVolatilityStructure :: (GenYieldTermStructure y) -> (GenOptionletVolatilityStructure ov) -> IO ((PricingEngine))
bachelierCapFloorEngineFromVolatilityStructure a1 a2 =
  withYieldTermStructure a1 $ \a1' -> 
  withOptionletVolatilityStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  bachelierCapFloorEngineFromVolatilityStructure'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 741 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier (normal) cap\/floor engine, taking a flat volatility quote
bachelierCapFloorEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> IO ((PricingEngine))
bachelierCapFloorEngine a1 a2 a3 =
  withYieldTermStructure a1 $ \a1' -> 
  withQuote a2 $ \a2' -> 
  withDayCounter a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  bachelierCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 744 "./QuantLib/PricingEngine.chs" #-}


-- |Black-formula YoY inflation cap\/floor engine. The nominal discount curve and the index's
-- own linked 'QuantLib.TermStructure.Inflation.YoYInflationTermStructure' are separate --
-- @nominalTermStructure@ discounts cashflows, while the index forecasts them.
yoyInflationBlackCapFloorEngine :: (GenYoYInflationIndex yidx) -> (YoYOptionletVolatilitySurface) -- ^vol
 -> (GenYieldTermStructure y) -- ^nominalTermStructure
 -> IO ((PricingEngine))
yoyInflationBlackCapFloorEngine a1 a2 a3 =
  withYoYInflationIndex a1 $ \a1' -> 
  withGenVolatilityTermStructure a2 $ \a2' -> 
  withYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  yoyInflationBlackCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 752 "./QuantLib/PricingEngine.chs" #-}


-- |as 'yoyInflationBlackCapFloorEngine', but unit-displaced Black
yoyInflationUnitDisplacedBlackCapFloorEngine :: (GenYoYInflationIndex yidx) -> (YoYOptionletVolatilitySurface) -- ^vol
 -> (GenYieldTermStructure y) -- ^nominalTermStructure
 -> IO ((PricingEngine))
yoyInflationUnitDisplacedBlackCapFloorEngine a1 a2 a3 =
  withYoYInflationIndex a1 $ \a1' -> 
  withGenVolatilityTermStructure a2 $ \a2' -> 
  withYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  yoyInflationUnitDisplacedBlackCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 758 "./QuantLib/PricingEngine.chs" #-}


-- |as 'yoyInflationBlackCapFloorEngine', but Bachelier (normal model)
yoyInflationBachelierCapFloorEngine :: (GenYoYInflationIndex yidx) -> (YoYOptionletVolatilitySurface) -- ^vol
 -> (GenYieldTermStructure y) -- ^nominalTermStructure
 -> IO ((PricingEngine))
yoyInflationBachelierCapFloorEngine a1 a2 a3 =
  withYoYInflationIndex a1 $ \a1' -> 
  withGenVolatilityTermStructure a2 $ \a2' -> 
  withYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  yoyInflationBachelierCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 764 "./QuantLib/PricingEngine.chs" #-}


-- |The only 'QuantLib.Instrument.InflationCapFloor.CPICapFloor' pricing engine in QL 1.43 --
-- prices purely by interpolating a market price surface, no stochastic-vol model (see that
-- type's own haddock for the CPI\/YoY asymmetry).
interpolatingCpiCapFloorEngine :: (CPICapFloorTermPriceSurface) -> IO ((PricingEngine))
interpolatingCpiCapFloorEngine a1 =
  withGenTermStructure a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  interpolatingCpiCapFloorEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 770 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier (normal) swaption engine, taking a flat volatility quote
bachelierSwaptionEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> (CashAnnuityModel) -- ^model
 -> IO ((PricingEngine))
bachelierSwaptionEngine a1 a2 a3 a4 =
  withYieldTermStructure a1 $ \a1' -> 
  withQuote a2 $ \a2' -> 
  withDayCounter a3 $ \a3' -> 
  let {a4' = (fromIntegral . fromEnum) a4} in 
  preErrorCheck $ \a5' -> 
  bachelierSwaptionEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 774 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier (normal) swaption engine, taking a swaption volatility structure
bachelierSwaptionEngineFromVolatilityStructure :: (GenYieldTermStructure y) -> (GenSwaptionVolatilityStructure sv) -> IO ((PricingEngine))
bachelierSwaptionEngineFromVolatilityStructure a1 a2 =
  withYieldTermStructure a1 $ \a1' -> 
  withSwaptionVolatilityStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  bachelierSwaptionEngineFromVolatilityStructure'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 777 "./QuantLib/PricingEngine.chs" #-}


-- |analytic European option pricer including stochastic interest rates (Black-Scholes-Merton + Hull-White)
analyticBsmHullWhiteEngine :: (Double) -> (GeneralizedBlackScholesProcess) -> (HullWhite) -> IO ((PricingEngine))
analyticBsmHullWhiteEngine a1 a2 a3 =
  let {a1' = realToFrac a1} in 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  withHullWhite a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  analyticBsmHullWhiteEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 780 "./QuantLib/PricingEngine.chs" #-}


-- |the term structure is only needed when the short-rate model cannot provide one itself.
analyticCapFloorEngine :: (AffineModel) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
analyticCapFloorEngine a1 a2 =
  withStandalone a1 $ \a1' -> 
  withMaybeYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  analyticCapFloorEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 783 "./QuantLib/PricingEngine.chs" #-}


-- |cap\/floor pricing engine for any one-factor Gaussian short-rate model, evaluated by
-- integration over the model's state variable. As 'gaussian1dSwaptionEngine', without
-- 'Probabilities'.
gaussian1dCapFloorEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 -> (Double) -- ^stddevs
 -> (Bool) -- ^extrapolatePayoff
 -> (Bool) -- ^flatPayoffExtrapolation
 -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 -> IO ((PricingEngine))
gaussian1dCapFloorEngine :: forall y.
Gaussian1dModel
-> Int
-> Double
-> Bool
-> Bool
-> Maybe (GenYieldTermStructure y)
-> IO PricingEngine
gaussian1dCapFloorEngine Gaussian1dModel
a1 Int
a2 Double
a3 Bool
a4 Bool
a5 Maybe (GenYieldTermStructure y)
a6 =
  Gaussian1dModel
-> (Ptr CGaussian1dModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone Gaussian1dModel
a1 ((Ptr CGaussian1dModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CGaussian1dModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGaussian1dModel'
a1' -> 
  let {a2' :: CInt
a2' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CInt
a4' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a4} in 
  let {a5' :: CInt
a5' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a5} in 
  Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall y b.
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure Maybe (GenYieldTermStructure y)
a6 ((Ptr CYieldTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CYieldTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a6' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a7' -> 
  Ptr CGaussian1dModel'
-> CInt
-> CDouble
-> CInt
-> CInt
-> Ptr CYieldTermStructure'
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
gaussian1dCapFloorEngine'_ Ptr CGaussian1dModel'
a1' CInt
a2' CDouble
a3' CInt
a4' CInt
a5' Ptr CYieldTermStructure'
a6' Ptr (Ptr CChar)
a7' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a7'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 794 "./QuantLib/PricingEngine.chs" #-}


-- |analytic pricing engine for vanilla options under a GJR-GARCH process
analyticGjrGarchEngine :: (GJRGARCHModel) -> IO ((PricingEngine))
analyticGjrGarchEngine a1 =
  withGenCalibratedModel a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  analyticGjrGarchEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 797 "./QuantLib/PricingEngine.chs" #-}


-- |semi-analytic Heston-model pricing engine, integrating with a fixed relative tolerance and evaluation cap
analyticHestonEngineTolerance :: (GenHestonModel hm) -> (Double) -- ^relTolerance
 -> (Word) -- ^maxEvaluations
 -> IO ((PricingEngine))
analyticHestonEngineTolerance a1 a2 a3 =
  withHestonModel a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  analyticHestonEngineTolerance'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 802 "./QuantLib/PricingEngine.chs" #-}


-- |semi-analytic pricing engine combining a Heston equity model with a Hull-White short-rate model
analyticHestonHullWhiteEngineOrder :: (GenHestonModel hm) -> (HullWhite) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
analyticHestonHullWhiteEngineOrder a1 a2 a3 =
  withHestonModel a1 $ \a1' -> 
  withHullWhite a2 $ \a2' -> 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  analyticHestonHullWhiteEngineOrder'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 807 "./QuantLib/PricingEngine.chs" #-}


-- |semi-analytic pricing engine for the Bates (Heston plus jumps) model, integrating with a fixed order
batesEngineOrder :: (GenBatesModel bm) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
batesEngineOrder a1 a2 =
  withBatesModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  batesEngineOrder'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 812 "./QuantLib/PricingEngine.chs" #-}


-- |FFT-based pricing engine for vanilla options under a Black-Scholes process
fftVanillaEngine :: (GeneralizedBlackScholesProcess) -> (Double) -- ^logStrikeSpacing
 -> IO ((PricingEngine))
fftVanillaEngine a1 a2 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  fftVanillaEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 816 "./QuantLib/PricingEngine.chs" #-}


-- |swaption pricing engine for the G2 two-factor short-rate model, priced via the Black formula
g2SwaptionEngine :: (G2) -> (Double) -- ^range
 -> (Word) -- ^intervals
 -> IO ((PricingEngine))
g2SwaptionEngine a1 a2 a3 =
  withG2 a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  g2SwaptionEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 821 "./QuantLib/PricingEngine.chs" #-}


-- |jump-diffusion pricing engine for vanilla options, taking a Merton76 process
jumpDiffusionEngine :: (Merton76Process) -> (Double) -- ^relativeAccuracy
 -> (Word) -- ^maxIterations
 -> IO ((PricingEngine))
jumpDiffusionEngine a1 a2 a3 =
  withGenStochasticProcess1D a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  jumpDiffusionEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 827 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for caps\/floors under a short-rate model
treeCapFloorEngineTimeSteps :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeCapFloorEngineTimeSteps a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeCapFloorEngineTimeSteps'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 831 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for swaptions under a short-rate model
treeSwaptionEngineTimeSteps :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeSwaptionEngineTimeSteps a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeSwaptionEngineTimeSteps'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 835 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for plain vanilla swaps under a short-rate model
treeVanillaSwapEngineTimeSteps :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeVanillaSwapEngineTimeSteps a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeVanillaSwapEngineTimeSteps'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 839 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for European vanilla options using the Variance Gamma model, integrated numerically
varianceGammaEngine :: (VarianceGammaProcess) -> (Double) -- ^absoluteError
 -> IO ((PricingEngine))
varianceGammaEngine a1 a2 =
  withGenStochasticProcess1D a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  varianceGammaEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 844 "./QuantLib/PricingEngine.chs" #-}


-- |semi-analytic Heston-model pricing engine, integrating with a fixed quadrature order
analyticHestonEngineOrder :: (GenHestonModel hm) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
analyticHestonEngineOrder a1 a2 =
  withHestonModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  analyticHestonEngineOrder'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 848 "./QuantLib/PricingEngine.chs" #-}


-- |Semi-analytic Heston engine with either fixed-order or tolerance-based integration.
analyticHestonEngine :: GenHestonModel hm -> IntegrationControl -> IO PricingEngine
analyticHestonEngine model control =
  case control of
    IntegrationOrder order -> analyticHestonEngineOrder model order
    IntegrationTolerance tolerance evaluations -> analyticHestonEngineTolerance model tolerance evaluations

-- |The complex-logarithm evaluation formula 'AnalyticHestonEngine' would pick for the given
-- maturity and Heston parameters when constructed with 'ComplexLogFormula' left to default to
-- the model's own heuristic (mirrors upstream's asymptotic-characteristic-function threshold).
analyticHestonEngineOptimalControlVariate :: (Double) -- ^t
 -> (Double) -- ^v0
 -> (Double) -- ^kappa
 -> (Double) -- ^theta
 -> (Double) -- ^sigma
 -> (Double) -- ^rho
 -> (ComplexLogFormula)
analyticHestonEngineOptimalControlVariate :: Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> ComplexLogFormula
analyticHestonEngineOptimalControlVariate Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 =
  IO ComplexLogFormula -> ComplexLogFormula
forall a. IO a -> a
C2HSImp.unsafePerformIO (IO ComplexLogFormula -> ComplexLogFormula)
-> IO ComplexLogFormula -> ComplexLogFormula
forall a b. (a -> b) -> a -> b
$
  let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  CDouble
-> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> IO CInt
analyticHestonEngineOptimalControlVariate'_ CDouble
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' IO CInt -> (CInt -> IO ComplexLogFormula) -> IO ComplexLogFormula
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
res ->
  let {res' :: ComplexLogFormula
res' = (Int -> ComplexLogFormula
forall a. Enum a => Int -> a
toEnum (Int -> ComplexLogFormula)
-> (CInt -> Int) -> CInt -> ComplexLogFormula
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
res} in
  ComplexLogFormula -> IO ComplexLogFormula
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (ComplexLogFormula
res')

{-# LINE 866 "./QuantLib/PricingEngine.chs" #-}


-- |semi-analytic Heston/Hull-White engine, integrating with a fixed relative tolerance and evaluation cap
analyticHestonHullWhiteEngineTolerance :: (GenHestonModel hm) -> (HullWhite) -> (Double) -- ^relTolerance
 -> (Word) -- ^maxEvaluations
 -> IO ((PricingEngine))
analyticHestonHullWhiteEngineTolerance a1 a2 a3 a4 =
  withHestonModel a1 $ \a1' -> 
  withHullWhite a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  let {a4' = fromIntegral a4} in 
  preErrorCheck $ \a5' -> 
  analyticHestonHullWhiteEngineTolerance'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 871 "./QuantLib/PricingEngine.chs" #-}


-- |Semi-analytic Heston/Hull-White engine with fixed-order or tolerance-based integration.
analyticHestonHullWhiteEngine :: GenHestonModel hm -> HullWhite -> IntegrationControl -> IO PricingEngine
analyticHestonHullWhiteEngine heston hullWhite control =
  case control of
    IntegrationOrder order -> analyticHestonHullWhiteEngineOrder heston hullWhite order
    IntegrationTolerance tolerance evaluations -> analyticHestonHullWhiteEngineTolerance heston hullWhite tolerance evaluations

-- |semi-analytic Bates-model pricing engine, integrating with a fixed relative tolerance and evaluation cap
batesEngineTolerance :: (GenBatesModel bm) -> (Double) -- ^relTolerance
 -> (Word) -- ^maxEvaluations
 -> IO ((PricingEngine))
batesEngineTolerance :: forall bm. GenBatesModel bm -> Double -> Word -> IO PricingEngine
batesEngineTolerance GenBatesModel bm
a1 Double
a2 Word
a3 =
  GenBatesModel bm
-> (Ptr CBatesModel' -> IO PricingEngine) -> IO PricingEngine
forall bm b. GenBatesModel bm -> (Ptr CBatesModel' -> IO b) -> IO b
withBatesModel GenBatesModel bm
a1 ((Ptr CBatesModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CBatesModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CBatesModel'
a1' -> 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' -> 
  Ptr CBatesModel'
-> CDouble -> CUInt -> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
batesEngineTolerance'_ Ptr CBatesModel'
a1' CDouble
a2' CUInt
a3' Ptr (Ptr CChar)
a4' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a4'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 883 "./QuantLib/PricingEngine.chs" #-}


-- |Semi-analytic Bates engine with either fixed-order or tolerance-based integration.
batesEngine :: GenBatesModel bm -> IntegrationControl -> IO PricingEngine
batesEngine model control =
  case control of
    IntegrationOrder order -> batesEngineOrder model order
    IntegrationTolerance tolerance evaluations -> batesEngineTolerance model tolerance evaluations

-- |Barone-Adesi and Whaley (1987) quadratic-approximation engine for American options
baroneAdesiWhaleyApproximationEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
baroneAdesiWhaleyApproximationEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine
baroneAdesiWhaleyApproximationEngine GeneralizedBlackScholesProcess
a1 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a2' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
baroneAdesiWhaleyApproximationEngine'_ Ptr CGeneralizedBlackScholesProcess'
a1' Ptr (Ptr CChar)
a2' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a2'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 893 "./QuantLib/PricingEngine.chs" #-}


batesDetJumpEngineTolerance :: (BatesDetJumpModel) -> (Double) -- ^relTolerance
 -> (Word) -- ^maxEvaluations
 -> IO ((PricingEngine))
batesDetJumpEngineTolerance a1 a2 a3 =
  withBatesDetJumpModel a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  batesDetJumpEngineTolerance'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 897 "./QuantLib/PricingEngine.chs" #-}


batesDetJumpEngineOrder :: (BatesDetJumpModel) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
batesDetJumpEngineOrder a1 a2 =
  withBatesDetJumpModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  batesDetJumpEngineOrder'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 900 "./QuantLib/PricingEngine.chs" #-}


-- |Semi-analytic engine for the Bates model with deterministic jumps, with fixed-order or tolerance-based integration.
batesDetJumpEngine :: BatesDetJumpModel -> IntegrationControl -> IO PricingEngine
batesDetJumpEngine model control =
  case control of
    IntegrationOrder order -> batesDetJumpEngineOrder model order
    IntegrationTolerance tolerance evaluations -> batesDetJumpEngineTolerance model tolerance evaluations

batesDoubleExpDetJumpEngineTolerance :: (BatesDoubleExpDetJumpModel) -> (Double) -- ^relTolerance
 -> (Word) -- ^maxEvaluations
 -> IO ((PricingEngine))
batesDoubleExpDetJumpEngineTolerance :: BatesDoubleExpDetJumpModel -> Double -> Word -> IO PricingEngine
batesDoubleExpDetJumpEngineTolerance BatesDoubleExpDetJumpModel
a1 Double
a2 Word
a3 =
  BatesDoubleExpDetJumpModel
-> (Ptr CBatesDoubleExpDetJumpModel' -> IO PricingEngine)
-> IO PricingEngine
forall b.
BatesDoubleExpDetJumpModel
-> (Ptr CBatesDoubleExpDetJumpModel' -> IO b) -> IO b
withBatesDoubleExpDetJumpModel BatesDoubleExpDetJumpModel
a1 ((Ptr CBatesDoubleExpDetJumpModel' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CBatesDoubleExpDetJumpModel' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CBatesDoubleExpDetJumpModel'
a1' -> 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' -> 
  Ptr CBatesDoubleExpDetJumpModel'
-> CDouble -> CUInt -> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
batesDoubleExpDetJumpEngineTolerance'_ Ptr CBatesDoubleExpDetJumpModel'
a1' CDouble
a2' CUInt
a3' Ptr (Ptr CChar)
a4' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a4'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  return (res')

{-# LINE 911 "./QuantLib/PricingEngine.chs" #-}


batesDoubleExpDetJumpEngineOrder :: (BatesDoubleExpDetJumpModel) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
batesDoubleExpDetJumpEngineOrder a1 a2 =
  withBatesDoubleExpDetJumpModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  batesDoubleExpDetJumpEngineOrder'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 914 "./QuantLib/PricingEngine.chs" #-}


-- |Semi-analytic engine for the double-exponential-jump Bates model with deterministic jumps, with fixed-order or tolerance-based integration.
batesDoubleExpDetJumpEngine :: BatesDoubleExpDetJumpModel -> IntegrationControl -> IO PricingEngine
batesDoubleExpDetJumpEngine model control =
  case control of
    IntegrationOrder order -> batesDoubleExpDetJumpEngineOrder model order
    IntegrationTolerance tolerance evaluations -> batesDoubleExpDetJumpEngineTolerance model tolerance evaluations

batesDoubleExpEngineTolerance :: (GenBatesDoubleExpModel bdem) -> (Double) -- ^relTolerance
 -> (Word) -- ^maxEvaluations
 -> IO ((PricingEngine))
batesDoubleExpEngineTolerance :: forall bdem.
GenBatesDoubleExpModel bdem -> Double -> Word -> IO PricingEngine
batesDoubleExpEngineTolerance GenBatesDoubleExpModel bdem
a1 Double
a2 Word
a3 =
  GenBatesDoubleExpModel bdem
-> (Ptr CBatesDoubleExpModel' -> IO PricingEngine)
-> IO PricingEngine
forall bdem b.
GenBatesDoubleExpModel bdem
-> (Ptr CBatesDoubleExpModel' -> IO b) -> IO b
withBatesDoubleExpModel GenBatesDoubleExpModel bdem
a1 ((Ptr CBatesDoubleExpModel' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CBatesDoubleExpModel' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CBatesDoubleExpModel'
a1' -> 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' -> 
  Ptr CBatesDoubleExpModel'
-> CDouble -> CUInt -> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
batesDoubleExpEngineTolerance'_ Ptr CBatesDoubleExpModel'
a1' CDouble
a2' CUInt
a3' Ptr (Ptr CChar)
a4' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a4'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 925 "./QuantLib/PricingEngine.chs" #-}


batesDoubleExpEngineOrder :: (GenBatesDoubleExpModel bdem) -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
batesDoubleExpEngineOrder a1 a2 =
  withBatesDoubleExpModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  batesDoubleExpEngineOrder'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 928 "./QuantLib/PricingEngine.chs" #-}


-- |Semi-analytic engine for the double-exponential-jump Bates model, with fixed-order or tolerance-based integration.
batesDoubleExpEngine :: GenBatesDoubleExpModel bdem -> IntegrationControl -> IO PricingEngine
batesDoubleExpEngine model control =
  case control of
    IntegrationOrder order -> batesDoubleExpEngineOrder model order
    IntegrationTolerance tolerance evaluations -> batesDoubleExpEngineTolerance model tolerance evaluations

-- |Bjerksund and Stensland (1993) approximation engine for American options
bjerksundStenslandApproximationEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
bjerksundStenslandApproximationEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine
bjerksundStenslandApproximationEngine GeneralizedBlackScholesProcess
a1 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a2' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
bjerksundStenslandApproximationEngine'_ Ptr CGeneralizedBlackScholesProcess'
a1' Ptr (Ptr CChar)
a2' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a2'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 938 "./QuantLib/PricingEngine.chs" #-}


-- |American engine based on the QD+ approximation to the exercise boundary. Mainly a good
-- initial guess for the exercise boundary of 'qdFpAmericanEngine'; usable as a standalone
-- (lower-accuracy) American pricer on its own.
qdPlusAmericanEngine :: (GeneralizedBlackScholesProcess) -> (Word) -- ^interpolationPoints, number of Chebyshev nodes used to interpolate the exercise boundary
 -> (SolverType) -- ^solverType, root-finding method used to locate the exercise boundary
 -> (Double) -- ^eps, solver accuracy
 -> (Maybe Word) -- ^maxIter, solver iteration cap; Nothing uses upstream's default
 -> IO ((PricingEngine))
qdPlusAmericanEngine :: GeneralizedBlackScholesProcess
-> Word -> SolverType -> Double -> Maybe Word -> IO PricingEngine
qdPlusAmericanEngine GeneralizedBlackScholesProcess
a1 Word
a2 SolverType
a3 Double
a4 Maybe Word
a5 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CInt
a3' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (SolverType -> Int) -> SolverType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SolverType -> Int
forall a. Enum a => a -> Int
fromEnum) SolverType
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CUInt
a5' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a5} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a6' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> CUInt
-> CInt
-> CDouble
-> CUInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
qdPlusAmericanEngine'_ Ptr CGeneralizedBlackScholesProcess'
a1' CUInt
a2' CInt
a3' CDouble
a4' CUInt
a5' Ptr (Ptr CChar)
a6' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a6'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 948 "./QuantLib/PricingEngine.chs" #-}


-- |High performance\/precision American engine based on fixed point iteration for the exercise
-- boundary (Andersen, Lake and Offengenden 2015; Andersen and Lake 2021). 'QdFpScheme' selects
-- one of upstream's three built-in 'iterationScheme's ('FastScheme', 'AccurateScheme',
-- 'HighPrecisionScheme'), trading speed for accuracy.
qdFpAmericanEngine :: (GeneralizedBlackScholesProcess) -> (QdFpScheme) -- ^iterationScheme
 -> (FixedPointEquation) -- ^fpEquation, which fixed-point formulation of the exercise boundary equation to solve
 -> IO ((PricingEngine))
qdFpAmericanEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  let {a3' = (fromIntegral . fromEnum) a3} in 
  preErrorCheck $ \a4' -> 
  qdFpAmericanEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 957 "./QuantLib/PricingEngine.chs" #-}


-- |Vecer (2001) engine for continuous-averaging arithmetic Asian options, replicating the average
-- by a self-financing strategy in the underlying and solving the resulting PDE on a finite
-- @[zMin,zMax]@ grid; requires @zMin <= 0 <= zMax@ and @startDate@ no earlier than the evaluation
-- date (seasoned Asians are not supported). @currentAverage@ is accepted for parity with upstream's
-- constructor but is not read by the current implementation (only the not-yet-seasoned case is
-- handled), so 'Nothing' is fine.
continuousArithmeticAsianVecerEngine :: (GeneralizedBlackScholesProcess) -> (Maybe (GenQuote q)) -- ^currentAverage
 -> (Day) -- ^startDate
 -> (Word) -- ^timeSteps
 -> (Word) -- ^assetSteps
 -> (Double) -- ^zMin
 -> (Double) -- ^zMax
 -> IO ((PricingEngine))
continuousArithmeticAsianVecerEngine :: forall q.
GeneralizedBlackScholesProcess
-> Maybe (GenQuote q)
-> Day
-> Word
-> Word
-> Double
-> Double
-> IO PricingEngine
continuousArithmeticAsianVecerEngine GeneralizedBlackScholesProcess
a1 Maybe (GenQuote q)
a2 Day
a3 Word
a4 Word
a5 Double
a6 Double
a7 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  Maybe (GenQuote q)
-> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall q b. Maybe (GenQuote q) -> (Ptr CQuote' -> IO b) -> IO b
withMaybeQuote Maybe (GenQuote q)
a2 ((Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CQuote' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a2' -> 
  Day -> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO PricingEngine) -> IO PricingEngine)
-> (CInt -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \CInt
a3' -> 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a8' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> Ptr CQuote'
-> CInt
-> CUInt
-> CUInt
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
continuousArithmeticAsianVecerEngine'_ Ptr CGeneralizedBlackScholesProcess'
a1' Ptr CQuote'
a2' CInt
a3' CUInt
a4' CUInt
a5' CDouble
a6' CDouble
a7' Ptr (Ptr CChar)
a8' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a8'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 972 "./QuantLib/PricingEngine.chs" #-}


-- |CDS pricing engine that integrates the default-leg payoff over the CDS's step-wise schedule
integralCdsEngine :: ((Word,TimeUnit)) -- ^integrationStep
 -> (GenDefaultProbabilityTermStructure d) -> (Double) -- ^recoveryRate
 -> (GenYieldTermStructure y) -- ^discountCurve
 -> (Maybe Bool) -- ^includeSettlementDateFlows
 -> IO ((PricingEngine))
integralCdsEngine a1 a2 a3 a4 a5 =
  let {(a1'1, a1'2) = fromEnumQuantity a1} in 
  withDefaultProbabilityTermStructure a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  withYieldTermStructure a4 $ \a4' -> 
  let {a5' = fromMaybeBool a5} in 
  preErrorCheck $ \a6' -> 
  integralCdsEngine'_ a1'1  a1'2 a2' a3' a4' a5' a6' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 979 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for European vanilla options using an integral approach
integralEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
integralEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  integralEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 982 "./QuantLib/PricingEngine.chs" #-}


-- |the term structure is only needed when the short-rate model cannot provide one itself.
jamshidianSwaptionEngine :: (GenOneFactorAffineModel om) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
jamshidianSwaptionEngine a1 a2 =
  withOneFactorAffineModel a1 $ \a1' -> 
  withMaybeYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  jamshidianSwaptionEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 985 "./QuantLib/PricingEngine.chs" #-}


-- |swaption pricing engine for any one-factor Gaussian short-rate model, evaluated by integration over the model's state variable
gaussian1dSwaptionEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 -> (Double) -- ^stddevs
 -> (Bool) -- ^extrapolatePayoff
 -> (Bool) -- ^flatPayoffExtrapolation
 -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 -> (Probabilities) -- ^probabilities
 -> IO ((PricingEngine))
gaussian1dSwaptionEngine a1 a2 a3 a4 a5 a6 a7 =
  withStandalone a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  withMaybeYieldTermStructure a6 $ \a6' -> 
  let {a7' = (fromIntegral . fromEnum) a7} in 
  preErrorCheck $ \a8' -> 
  gaussian1dSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a8'>>
  return (res')

{-# LINE 995 "./QuantLib/PricingEngine.chs" #-}


-- |As 'gaussian1dSwaptionEngine', for a 'QuantLib.Instrument.Swap.NonstandardSwaption'. Adds
-- an optional OAS ('oas', continuously compounded w.r.t. the discount curve's day counter) on
-- top of the shared parameters.
gaussian1dNonstandardSwaptionEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 -> (Double) -- ^stddevs
 -> (Bool) -- ^extrapolatePayoff
 -> (Bool) -- ^flatPayoffExtrapolation
 -> (Maybe (GenQuote q)) -- ^oas
 -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 -> (Probabilities) -- ^probabilities
 -> IO ((PricingEngine))
gaussian1dNonstandardSwaptionEngine a1 a2 a3 a4 a5 a6 a7 a8 =
  withStandalone a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  withMaybeQuote a6 $ \a6' -> 
  withMaybeYieldTermStructure a7 $ \a7' -> 
  let {a8' = (fromIntegral . fromEnum) a8} in 
  preErrorCheck $ \a9' -> 
  gaussian1dNonstandardSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 1008 "./QuantLib/PricingEngine.chs" #-}


-- |As 'gaussian1dNonstandardSwaptionEngine', for a
-- 'QuantLib.Instrument.Swap.FloatFloatSwaption'. Adds 'includeTodaysExercise' -- whether a
-- fixing due exactly \"today\" counts as part of the exercise-into leg.
gaussian1dFloatFloatSwaptionEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 -> (Double) -- ^stddevs
 -> (Bool) -- ^extrapolatePayoff
 -> (Bool) -- ^flatPayoffExtrapolation
 -> (Maybe (GenQuote q)) -- ^oas
 -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 -> (Bool) -- ^includeTodaysExercise
 -> (Probabilities) -- ^probabilities
 -> IO ((PricingEngine))
gaussian1dFloatFloatSwaptionEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  withStandalone a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  withMaybeQuote a6 $ \a6' -> 
  withMaybeYieldTermStructure a7 $ \a7' -> 
  let {a8' = C2HSImp.fromBool a8} in 
  let {a9' = (fromIntegral . fromEnum) a9} in 
  preErrorCheck $ \a10' -> 
  gaussian1dFloatFloatSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1022 "./QuantLib/PricingEngine.chs" #-}


-- |swaption pricing engine using Jamshidian's decomposition, for any one-factor Gaussian
-- short-rate model.
gaussian1dJamshidianSwaptionEngine :: (Gaussian1dModel) -> IO ((PricingEngine))
gaussian1dJamshidianSwaptionEngine a1 =
  withStandalone a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  gaussian1dJamshidianSwaptionEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 1026 "./QuantLib/PricingEngine.chs" #-}


-- |Ju (1999) quadratic-approximation engine for American options
juQuadraticApproximationEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
juQuadraticApproximationEngine a1 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  juQuadraticApproximationEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 1029 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for a spread option on two futures/assets
kirkEngine :: (BlackProcess) -> (BlackProcess) -> (Double) -- ^correlation
 -> IO ((PricingEngine))
kirkEngine a1 a2 a3 =
  withBlackProcess a1 $ \a1' -> 
  withBlackProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  kirkEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1033 "./QuantLib/PricingEngine.chs" #-}


-- |CDS pricing engine using the mid-point approximation, evaluating the default leg at the mid-point of each accrual period
midPointCdsEngine :: (GenDefaultProbabilityTermStructure d) -> (Double) -- ^recoveryRate
 -> (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
 -> IO ((PricingEngine))
midPointCdsEngine a1 a2 a3 a4 =
  withDefaultProbabilityTermStructure a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  withYieldTermStructure a3 $ \a3' -> 
  let {a4' = fromMaybeBool a4} in 
  preErrorCheck $ \a5' -> 
  midPointCdsEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1039 "./QuantLib/PricingEngine.chs" #-}


-- |Synthetic CDO tranche pricing engine using the mid-point approximation, evaluating the
-- expected tranche loss at the mid-point of each accrual/protection period. The basket must
-- already have a 'QuantLib.Credit.DefaultLossModel' attached.
midPointCdoEngine :: (GenYieldTermStructure y) -- ^discountCurve
 -> IO ((PricingEngine))
midPointCdoEngine a1 =
  withYieldTermStructure a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  midPointCdoEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 1045 "./QuantLib/PricingEngine.chs" #-}


-- |Synthetic CDO tranche pricing engine that integrates the expected tranche loss over
-- @stepSize@-sized steps of the tranche's schedule.
integralCdoEngine :: (GenYieldTermStructure y) -- ^discountCurve
 -> ((Word,TimeUnit)) -- ^stepSize
 -> IO ((PricingEngine))
integralCdoEngine a1 a2 =
  withYieldTermStructure a1 $ \a1' -> 
  let {(a2'1, a2'2) = fromEnumQuantity a2} in 
  preErrorCheck $ \a3' -> 
  integralCdoEngine'_ a1' a2'1  a2'2 a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1051 "./QuantLib/PricingEngine.chs" #-}


-- |Nth-to-default pricing engine that integrates the probability of at least @n@ defaults over
-- @integrationStep@-sized steps of the underlying basket's copula.
integralNtdEngine :: ((Word,TimeUnit)) -- ^integrationStep
 -> (GenYieldTermStructure y) -- ^discountCurve
 -> IO ((PricingEngine))
integralNtdEngine a1 a2 =
  let {(a1'1, a1'2) = fromEnumQuantity a1} in 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  integralNtdEngine'_ a1'1  a1'2 a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1057 "./QuantLib/PricingEngine.chs" #-}


-- |CDS pricing engine implementing the ISDA standard model
isdaCdsEngine :: (GenDefaultProbabilityTermStructure d) -> (Double) -- ^recoveryRate
 -> (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
 -> (NumericalFix) -- ^numericalFix
 -> (AccrualBias) -- ^accrualBias
 -> (ForwardsInCouponPeriod) -- ^forwardsInCouponPeriod
 -> IO ((PricingEngine))
isdaCdsEngine a1 a2 a3 a4 a5 a6 a7 =
  withDefaultProbabilityTermStructure a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  withYieldTermStructure a3 $ \a3' -> 
  let {a4' = fromMaybeBool a4} in 
  let {a5' = (fromIntegral . fromEnum) a5} in 
  let {a6' = (fromIntegral . fromEnum) a6} in 
  let {a7' = (fromIntegral . fromEnum) a7} in 
  preErrorCheck $ \a8' -> 
  isdaCdsEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a8'>>
  return (res')

{-# LINE 1066 "./QuantLib/PricingEngine.chs" #-}


-- |variance-swap pricing engine using a replicating portfolio of vanilla options at the given strikes
replicatingVarianceSwapEngine :: (GeneralizedBlackScholesProcess) -> (Double) -- ^dk
 -> (NonEmpty Double) -- ^callStrikes
 -> (NonEmpty Double) -- ^putStrikes
 -> IO ((PricingEngine))
replicatingVarianceSwapEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) -> 
  withNonEmptyDoubleArray a4 $ \(a4'1, a4'2) -> 
  preErrorCheck $ \a5' -> 
  replicatingVarianceSwapEngine'_ a1' a2' a3'1  a3'2 a4'1  a4'2 a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1072 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for 2D European basket options (Stulz formula)
stulzEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 -> IO ((PricingEngine))
stulzEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  stulzEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1076 "./QuantLib/PricingEngine.chs" #-}


-- |Bjerksund-Stensland (2014) closed-form pricing engine for a spread option on two futures
bjerksundStenslandSpreadEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 -> IO ((PricingEngine))
bjerksundStenslandSpreadEngine a1 a2 a3 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  bjerksundStenslandSpreadEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1080 "./QuantLib/PricingEngine.chs" #-}


-- |Chi-Fai Lo (2015) operator-splitting-approximation pricing engine for a spread option
operatorSplittingSpreadEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 -> (OperatorSplittingOrder) -- ^order, upstream default: 'Second'
 -> IO ((PricingEngine))
operatorSplittingSpreadEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  let {a4' = (fromIntegral . fromEnum) a4} in 
  preErrorCheck $ \a5' -> 
  operatorSplittingSpreadEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1085 "./QuantLib/PricingEngine.chs" #-}


-- |Pearson (1995) 1-D-numerical-integration pricing engine for a spread option
pearsonSpreadEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 -> (Double) -- ^integrationTolerance, upstream default: 1e-10
 -> (Word) -- ^maxIntegrationIterations, upstream default: 10000
 -> (Double) -- ^nStd, upstream default: 8.0
 -> IO ((PricingEngine))
pearsonSpreadEngine a1 a2 a3 a4 a5 a6 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  pearsonSpreadEngine'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 1092 "./QuantLib/PricingEngine.chs" #-}


-- |Gaussian-copula nested-Gauss-Hermite-quadrature pricing engine for a spread option with smile-implied marginals
gaussianCopulaSpreadEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 -> (Word) -- ^nPoints, upstream default: 64
 -> IO ((PricingEngine))
gaussianCopulaSpreadEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = realToFrac a3} in 
  let {a4' = fromIntegral a4} in 
  preErrorCheck $ \a5' -> 
  gaussianCopulaSpreadEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1097 "./QuantLib/PricingEngine.chs" #-}


-- |Choi (2018) \"sum of Black-Scholes-Merton models\" pricing engine for a basket option on
-- multiple underlyings, correlated via @rho@
choiBasketEngine :: NonEmpty GeneralizedBlackScholesProcess -> Matrix Double -- ^correlation matrix rho
  -> Double -- ^lambda, upstream default: 10.0
  -> Word -- ^maxNrIntegrationSteps, upstream default: unbounded; the C shim takes a 32-bit count
  -> Bool -- ^calcfwdDelta
  -> Bool -- ^controlVariate
  -> IO PricingEngine
choiBasketEngine ps (Matrix mr mc md) = qlChoiBasketEngine (toList ps) mr mc md
qlChoiBasketEngine :: ([GeneralizedBlackScholesProcess]) -> (Word) -> (Word) -> ([Double]) -> (Double) -- ^lambda
 -> (Word) -- ^maxNrIntegrationSteps
 -> (Bool) -- ^calcfwdDelta
 -> (Bool) -- ^controlVariate
 -> IO ((PricingEngine))
qlChoiBasketEngine :: [GeneralizedBlackScholesProcess]
-> Word
-> Word
-> [Double]
-> Double
-> Word
-> Bool
-> Bool
-> IO PricingEngine
qlChoiBasketEngine [GeneralizedBlackScholesProcess]
a1 Word
a2 Word
a3 [Double]
a4 Double
a5 Word
a6 Bool
a7 Bool
a8 =
  [GeneralizedBlackScholesProcess]
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess'))
    -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
[GenGeneralizedBlackScholesProcess gbs]
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess')) -> IO b)
-> IO b
withGeneralizedBlackScholesProcessArray [GeneralizedBlackScholesProcess]
a1 (((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess'))
  -> IO PricingEngine)
 -> IO PricingEngine)
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess'))
    -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \(CUInt
a1'1, Ptr (Ptr CGeneralizedBlackScholesProcess')
a1'2) -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  [Double] -> (Ptr CDouble -> IO PricingEngine) -> IO PricingEngine
forall b. [Double] -> (Ptr CDouble -> IO b) -> IO b
withDoubleArrayRaw [Double]
a4 ((Ptr CDouble -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CDouble -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
a4' -> 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in 
  let {a7' :: CInt
a7' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a7} in 
  let {a8' :: CInt
a8' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a8} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a9' -> 
  CUInt
-> Ptr (Ptr CGeneralizedBlackScholesProcess')
-> CUInt
-> CUInt
-> Ptr CDouble
-> CDouble
-> CUInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
qlChoiBasketEngine'_ CUInt
a1'1  Ptr (Ptr CGeneralizedBlackScholesProcess')
a1'2 CUInt
a2' CUInt
a3' Ptr CDouble
a4' CDouble
a5' CUInt
a6' CInt
a7' CInt
a8' Ptr (Ptr CChar)
a9' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a9'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1114 "./QuantLib/PricingEngine.chs" #-}


-- |Deng-Li-Zhou (2008) closed-form-approximation pricing engine for a spread option on multiple
-- underlyings, correlated via @rho@
dengLiZhouBasketEngine :: NonEmpty GeneralizedBlackScholesProcess -> Matrix Double -- ^correlation matrix rho
  -> IO PricingEngine
dengLiZhouBasketEngine ps (Matrix mr mc md) = qlDengLiZhouBasketEngine (toList ps) mr mc md
qlDengLiZhouBasketEngine :: ([GeneralizedBlackScholesProcess]) -> (Word) -> (Word) -> ([Double]) -> IO ((PricingEngine))
qlDengLiZhouBasketEngine a1 a2 a3 a4 =
  withGeneralizedBlackScholesProcessArray a1 $ \(a1'1, a1'2) -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  withDoubleArrayRaw a4 $ \a4' -> 
  preErrorCheck $ \a5' -> 
  qlDengLiZhouBasketEngine'_ a1'1  a1'2 a2' a3' a4' a5' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1123 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for a basket where all underlyings are driven by one stochastic factor
singleFactorBsmBasketEngine :: NonEmpty GeneralizedBlackScholesProcess
  -> Double -- ^xTol, upstream default: @1e4*QL_EPSILON@
  -> IO PricingEngine
singleFactorBsmBasketEngine ps = qlSingleFactorBsmBasketEngine (toList ps)
qlSingleFactorBsmBasketEngine :: ([GeneralizedBlackScholesProcess]) -> (Double) -- ^xTol
 -> IO ((PricingEngine))
qlSingleFactorBsmBasketEngine a1 a2 =
  withGeneralizedBlackScholesProcessArray a1 $ \(a1'1, a1'2) -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlSingleFactorBsmBasketEngine'_ a1'1  a1'2 a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1132 "./QuantLib/PricingEngine.chs" #-}


-- |Libor forward model swaption engine, priced via the Black formula
lfmSwaptionEngine :: (LiborForwardModel) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
lfmSwaptionEngine a1 a2 =
  withGenCalibratedModel a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  lfmSwaptionEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1135 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for caps\/floors under a short-rate model, on an explicit time grid
treeCapFloorEngineTimeGrid :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeCapFloorEngineTimeGrid a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  withTimeGrid a2 $ \a2' -> 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeCapFloorEngineTimeGrid'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1138 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for swaptions under a short-rate model, on an explicit time grid
treeSwaptionEngineTimeGrid :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeSwaptionEngineTimeGrid a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  withTimeGrid a2 $ \a2' -> 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeSwaptionEngineTimeGrid'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1141 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for plain vanilla swaps under a short-rate model, on an explicit time grid
treeVanillaSwapEngineTimeGrid :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeVanillaSwapEngineTimeGrid a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  withTimeGrid a2 $ \a2' -> 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeVanillaSwapEngineTimeGrid'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1144 "./QuantLib/PricingEngine.chs" #-}


-- |Numerical-lattice cap/floor engine using either a step count or an explicit grid.
treeCapFloorEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeCapFloorEngine model latticeTime curve =
  case latticeTime of
    TimeSteps steps -> treeCapFloorEngineTimeSteps model steps curve
    ExplicitTimeGrid grid -> treeCapFloorEngineTimeGrid model grid curve

-- |Numerical-lattice swaption engine using either a step count or an explicit grid.
treeSwaptionEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeSwaptionEngine model latticeTime curve =
  case latticeTime of
    TimeSteps steps -> treeSwaptionEngineTimeSteps model steps curve
    ExplicitTimeGrid grid -> treeSwaptionEngineTimeGrid model grid curve

-- |Numerical-lattice vanilla-swap engine using either a step count or an explicit grid.
treeVanillaSwapEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeVanillaSwapEngine :: forall sm y.
GenShortRateModel sm
-> LatticeTime
-> Maybe (GenYieldTermStructure y)
-> IO PricingEngine
treeVanillaSwapEngine GenShortRateModel sm
model LatticeTime
latticeTime Maybe (GenYieldTermStructure y)
curve =
  case LatticeTime
latticeTime of
    TimeSteps Word
steps -> GenShortRateModel sm
-> Word -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
forall sm y.
GenShortRateModel sm
-> Word -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeVanillaSwapEngineTimeSteps GenShortRateModel sm
model Word
steps Maybe (GenYieldTermStructure y)
curve
    ExplicitTimeGrid TimeGrid
grid -> GenShortRateModel sm
-> TimeGrid -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
forall sm y.
GenShortRateModel sm
-> TimeGrid -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeVanillaSwapEngineTimeGrid GenShortRateModel sm
model TimeGrid
grid Maybe (GenYieldTermStructure y)
curve

-- |Snapshots @rTS@/@fTS@/@fxVolTS@ at construction time (their underlying @shared_ptr@s are copied
-- out of their handles): a later relink of a 'RelinkableYieldTermStructure' or
-- 'RelinkableBlackVolTermStructure' passed in here will /not/ be reflected in this 'FdmQuantoHelper'.
fdmQuantoHelper :: (GenYieldTermStructure y1) -- ^rTS
 -> (GenYieldTermStructure y2) -- ^fTS
 -> (GenBlackVolTermStructure bv) -- ^fxVolTS
 -> (Double) -- ^equityFxCorrelation
 -> (Double) -- ^exchRateATMlevel
 -> IO ((FdmQuantoHelper))
fdmQuantoHelper :: forall y1 y2 bv.
GenYieldTermStructure y1
-> GenYieldTermStructure y2
-> GenBlackVolTermStructure bv
-> Double
-> Double
-> IO FdmQuantoHelper
fdmQuantoHelper GenYieldTermStructure y1
a1 GenYieldTermStructure y2
a2 GenBlackVolTermStructure bv
a3 Double
a4 Double
a5 =
  GenYieldTermStructure y1
-> (Ptr CYieldTermStructure' -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y1
a1 ((Ptr CYieldTermStructure' -> IO FdmQuantoHelper)
 -> IO FdmQuantoHelper)
-> (Ptr CYieldTermStructure' -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' -> 
  GenYieldTermStructure y2
-> (Ptr CYieldTermStructure' -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y2
a2 ((Ptr CYieldTermStructure' -> IO FdmQuantoHelper)
 -> IO FdmQuantoHelper)
-> (Ptr CYieldTermStructure' -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' -> 
  GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv
a3 ((Ptr CBlackVolTermStructure' -> IO FdmQuantoHelper)
 -> IO FdmQuantoHelper)
-> (Ptr CBlackVolTermStructure' -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a3' -> 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  (Ptr (Ptr CChar) -> IO FdmQuantoHelper) -> IO FdmQuantoHelper
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO FdmQuantoHelper) -> IO FdmQuantoHelper)
-> (Ptr (Ptr CChar) -> IO FdmQuantoHelper) -> IO FdmQuantoHelper
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a6' -> 
  Ptr CYieldTermStructure'
-> Ptr CYieldTermStructure'
-> Ptr CBlackVolTermStructure'
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CFdmQuantoHelper)
fdmQuantoHelper'_ Ptr CYieldTermStructure'
a1' Ptr CYieldTermStructure'
a2' Ptr CBlackVolTermStructure'
a3' CDouble
a4' CDouble
a5' Ptr (Ptr CChar)
a6' IO (Ptr CFdmQuantoHelper)
-> (Ptr CFdmQuantoHelper -> IO FdmQuantoHelper)
-> IO FdmQuantoHelper
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFdmQuantoHelper
res ->
  Ptr CFdmQuantoHelper -> IO FdmQuantoHelper
peekFdmQuantoHelper Ptr CFdmQuantoHelper
res IO FdmQuantoHelper
-> (FdmQuantoHelper -> IO FdmQuantoHelper) -> IO FdmQuantoHelper
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FdmQuantoHelper
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a6'IO () -> IO FdmQuantoHelper -> IO FdmQuantoHelper
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  FdmQuantoHelper -> IO FdmQuantoHelper
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FdmQuantoHelper
res')

{-# LINE 1175 "./QuantLib/PricingEngine.chs" #-}


-- |quanto drift adjustment @domesticRate - foreignRate + equityFxCorrelation*equityVol*fxVol@ over @[t1,t2]@
quantoAdjustment :: (FdmQuantoHelper) -> (Double) -- ^equityVol
 -> (Double) -- ^t1
 -> (Double) -- ^t2
 -> IO ((Double))
quantoAdjustment a1 a2 a3 a4 =
  withFdmQuantoHelper a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  quantoAdjustment'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a5'>>
  return (res')

{-# LINE 1182 "./QuantLib/PricingEngine.chs" #-}


-- |two-dimensional finite-differences Black-Scholes basket-option pricing engine
fd2dBlackScholesVanillaEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 -> (Word) -- ^xGrid, upstream default: 100
 -> (Word) -- ^yGrid, upstream default: 100
 -> (Word) -- ^tGrid, upstream default: 50
 -> (Word) -- ^dampingSteps, upstream default: 0
 -> (FdmScheme) -- ^schemeDesc, upstream default: 'Hundsdorfer'
 -> (Bool) -- ^localVol
 -> (Double) -- ^illegalLocalVolOverwrite, upstream default: @-Null\<Real\>()@
 -> IO ((PricingEngine))
fd2dBlackScholesVanillaEngine :: GeneralizedBlackScholesProcess
-> GeneralizedBlackScholesProcess
-> Double
-> Word
-> Word
-> Word
-> Word
-> FdmScheme
-> Bool
-> Double
-> IO PricingEngine
fd2dBlackScholesVanillaEngine GeneralizedBlackScholesProcess
a1 GeneralizedBlackScholesProcess
a2 Double
a3 Word
a4 Word
a5 Word
a6 Word
a7 FdmScheme
a8 Bool
a9 Double
a10 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a2 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a2' -> 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in 
  let {a7' :: CUInt
a7' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a7} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a8 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a8' -> 
  let {a9' :: CInt
a9' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a9} in 
  let {a10' :: CDouble
a10' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a10} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a11' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> Ptr CGeneralizedBlackScholesProcess'
-> CDouble
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> CInt
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fd2dBlackScholesVanillaEngine'_ Ptr CGeneralizedBlackScholesProcess'
a1' Ptr CGeneralizedBlackScholesProcess'
a2' CDouble
a3' CUInt
a4' CUInt
a5' CUInt
a6' CUInt
a7' Ptr CFdmSchemeDesc
a8' CInt
a9' CDouble
a10' Ptr (Ptr CChar)
a11' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a11'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1193 "./QuantLib/PricingEngine.chs" #-}


-- |n-dimensional finite-differences Black-Scholes basket-option pricing engine, with an explicit
-- per-axis grid size
fdndimBlackScholesVanillaEngineAxisGrids :: NonEmpty GeneralizedBlackScholesProcess -> Matrix Double -- ^correlation matrix rho
  -> NonEmpty Word -- ^xGrids, one per underlying
  -> Word -- ^tGrid, upstream default: 50
  -> Word -- ^dampingSteps, upstream default: 0
  -> FdmScheme -- ^schemeDesc, upstream default: 'Douglas'
  -> IO PricingEngine
fdndimBlackScholesVanillaEngineAxisGrids ps (Matrix mr mc md) xGrids = qlFdndimBlackScholesVanillaEngine (toList ps) mr mc md (toList xGrids)
qlFdndimBlackScholesVanillaEngine :: ([GeneralizedBlackScholesProcess]) -> (Word) -> (Word) -> ([Double]) -> ([Word]) -> (Word) -- ^tGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> IO ((PricingEngine))
qlFdndimBlackScholesVanillaEngine a1 a2 a3 a4 a5 a6 a7 a8 =
  withGeneralizedBlackScholesProcessArray a1 $ \(a1'1, a1'2) -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  withDoubleArrayRaw a4 $ \a4' -> 
  withIntArray a5 $ \(a5'1, a5'2) -> 
  let {a6' = fromIntegral a6} in 
  let {a7' = fromIntegral a7} in 
  withFdmSchemeDesc a8 $ \a8' -> 
  preErrorCheck $ \a9' -> 
  qlFdndimBlackScholesVanillaEngine'_ a1'1  a1'2 a2' a3' a4' a5'1  a5'2 a6' a7' a8' a9' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 1210 "./QuantLib/PricingEngine.chs" #-}


-- |n-dimensional finite-differences Black-Scholes basket-option pricing engine, auto-scaling every
-- axis' grid from a single size (largest eigenvalue gets @xGrid@)
fdndimBlackScholesVanillaEngineUniformGrid :: NonEmpty GeneralizedBlackScholesProcess -> Matrix Double -- ^correlation matrix rho
  -> Word -- ^xGrid
  -> Word -- ^tGrid, upstream default: 50
  -> Word -- ^dampingSteps, upstream default: 0
  -> FdmScheme -- ^schemeDesc, upstream default: 'Douglas'
  -> IO PricingEngine
fdndimBlackScholesVanillaEngineUniformGrid ps (Matrix mr mc md) = qlFdndimBlackScholesVanillaEngine1 (toList ps) mr mc md
qlFdndimBlackScholesVanillaEngine1 :: ([GeneralizedBlackScholesProcess]) -> (Word) -> (Word) -> ([Double]) -> (Word) -- ^xGrid
 -> (Word) -- ^tGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> IO ((PricingEngine))
qlFdndimBlackScholesVanillaEngine1 :: [GeneralizedBlackScholesProcess]
-> Word
-> Word
-> [Double]
-> Word
-> Word
-> Word
-> FdmScheme
-> IO PricingEngine
qlFdndimBlackScholesVanillaEngine1 [GeneralizedBlackScholesProcess]
a1 Word
a2 Word
a3 [Double]
a4 Word
a5 Word
a6 Word
a7 FdmScheme
a8 =
  [GeneralizedBlackScholesProcess]
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess'))
    -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
[GenGeneralizedBlackScholesProcess gbs]
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess')) -> IO b)
-> IO b
withGeneralizedBlackScholesProcessArray [GeneralizedBlackScholesProcess]
a1 (((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess'))
  -> IO PricingEngine)
 -> IO PricingEngine)
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess'))
    -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \(CUInt
a1'1, Ptr (Ptr CGeneralizedBlackScholesProcess')
a1'2) -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  [Double] -> (Ptr CDouble -> IO PricingEngine) -> IO PricingEngine
forall b. [Double] -> (Ptr CDouble -> IO b) -> IO b
withDoubleArrayRaw [Double]
a4 ((Ptr CDouble -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CDouble -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
a4' -> 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in 
  let {a7' :: CUInt
a7' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a7} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a8 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a8' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a9' -> 
  CUInt
-> Ptr (Ptr CGeneralizedBlackScholesProcess')
-> CUInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
qlFdndimBlackScholesVanillaEngine1'_ CUInt
a1'1  Ptr (Ptr CGeneralizedBlackScholesProcess')
a1'2 CUInt
a2' CUInt
a3' Ptr CDouble
a4' CUInt
a5' CUInt
a6' CUInt
a7' Ptr CFdmSchemeDesc
a8' Ptr (Ptr CChar)
a9' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a9'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1227 "./QuantLib/PricingEngine.chs" #-}


-- |N-dimensional Black-Scholes finite-difference engine with uniform or per-axis grids.
fdndimBlackScholesVanillaEngine :: NonEmpty GeneralizedBlackScholesProcess -> Matrix Double
  -> FdmGrid -> Word -> Word -> FdmScheme -> IO PricingEngine
fdndimBlackScholesVanillaEngine processes correlations grid =
  case grid of
    UniformGrid gridSize -> fdndimBlackScholesVanillaEngineUniformGrid processes correlations gridSize
    AxisGrids sizes -> fdndimBlackScholesVanillaEngineAxisGrids processes correlations sizes

-- |finite-differences swaption pricing engine for the G2 two-factor short-rate model
fdG2SwaptionEngine :: (G2) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^yGrid
 -> (Word) -- ^dampingSpecs
 -> (Double) -- ^invEps
 -> (FdmScheme) -> IO ((PricingEngine))
fdG2SwaptionEngine :: G2
-> Word
-> Word
-> Word
-> Word
-> Double
-> FdmScheme
-> IO PricingEngine
fdG2SwaptionEngine G2
a1 Word
a2 Word
a3 Word
a4 Word
a5 Double
a6 FdmScheme
a7 =
  G2 -> (Ptr CG2' -> IO PricingEngine) -> IO PricingEngine
forall b. G2 -> (Ptr CG2' -> IO b) -> IO b
withG2 G2
a1 ((Ptr CG2' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CG2' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CG2'
a1' -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a7 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a7' -> 
  preErrorCheck $ \a8' -> 
  fdG2SwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a8'>>
  return (res')

{-# LINE 1243 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences swaption pricing engine for the Hull-White short-rate model
fdHullWhiteSwaptionEngine :: (HullWhite) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^dampingSpecs
 -> (Double) -- ^invEps
 -> (FdmScheme) -> IO ((PricingEngine))
fdHullWhiteSwaptionEngine a1 a2 a3 a4 a5 a6 =
  withHullWhite a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = realToFrac a5} in 
  withFdmSchemeDesc a6 $ \a6' -> 
  preErrorCheck $ \a7' -> 
  fdHullWhiteSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 1250 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Black-Scholes barrier-option pricing engine
fdBlackScholesBarrierEngine :: (GeneralizedBlackScholesProcess) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Bool) -- ^localVol
 -> (Double) -- ^illegalLocalVolOverwrite
 -> IO ((PricingEngine))
fdBlackScholesBarrierEngine a1 a2 a3 a4 a5 a6 a7 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  withFdmSchemeDesc a5 $ \a5' -> 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = realToFrac a7} in 
  preErrorCheck $ \a8' -> 
  fdBlackScholesBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a8'>>
  return (res')

{-# LINE 1259 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Heston-model barrier-option pricing engine
fdHestonBarrierEngineNoDividends :: (GenHestonModel hm) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonBarrierEngineNoDividends a1 a2 a3 a4 a5 a6 a7 a8 =
  withHestonModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  withFdmSchemeDesc a6 $ \a6' -> 
  withMaybeLocalVolTermStructure a7 $ \a7' -> 
  let {a8' = realToFrac a8} in 
  preErrorCheck $ \a9' -> 
  fdHestonBarrierEngineNoDividends'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 1269 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Heston-model barrier-option pricing engine, with discrete dividends
fdHestonBarrierEngineWithDividends :: (GenHestonModel hm) -> ([Dividend]) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonBarrierEngineWithDividends a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  withHestonModel a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = fromIntegral a6} in 
  withFdmSchemeDesc a7 $ \a7' -> 
  withMaybeLocalVolTermStructure a8 $ \a8' -> 
  let {a9' = realToFrac a9} in 
  preErrorCheck $ \a10' -> 
  fdHestonBarrierEngineWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1280 "./QuantLib/PricingEngine.chs" #-}


-- |Finite-difference Heston barrier engine; an empty list selects the no-dividend overload.
fdHestonBarrierEngine :: GenHestonModel hm -> [Dividend] -> Word -> Word -> Word -> Word
  -> FdmScheme -> Maybe (GenLocalVolTermStructure lv) -> Double -> IO PricingEngine
fdHestonBarrierEngine model dividends =
  case dividends of
    [] -> fdHestonBarrierEngineNoDividends model
    _ -> fdHestonBarrierEngineWithDividends model dividends

-- |finite-differences Heston-model double-barrier-option pricing engine
fdHestonDoubleBarrierEngine :: (GenHestonModel hm) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonDoubleBarrierEngine :: forall hm lv.
GenHestonModel hm
-> Word
-> Word
-> Word
-> Word
-> FdmScheme
-> Maybe (GenLocalVolTermStructure lv)
-> Double
-> IO PricingEngine
fdHestonDoubleBarrierEngine GenHestonModel hm
a1 Word
a2 Word
a3 Word
a4 Word
a5 FdmScheme
a6 Maybe (GenLocalVolTermStructure lv)
a7 Double
a8 =
  GenHestonModel hm
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a1 ((Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a1' -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a6 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a6' -> 
  Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall lv b.
Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withMaybeLocalVolTermStructure Maybe (GenLocalVolTermStructure lv)
a7 ((Ptr CLocalVolTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CLocalVolTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CLocalVolTermStructure'
a7' -> 
  let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a9' -> 
  Ptr CHestonModel'
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> Ptr CLocalVolTermStructure'
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fdHestonDoubleBarrierEngine'_ Ptr CHestonModel'
a1' CUInt
a2' CUInt
a3' CUInt
a4' CUInt
a5' Ptr CFdmSchemeDesc
a6' Ptr CLocalVolTermStructure'
a7' CDouble
a8' Ptr (Ptr CChar)
a9' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a9'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1298 "./QuantLib/PricingEngine.chs" #-}


-- |/NB/ every Monte Carlo engine in this module is C++-templated on both an RNG policy and a
-- statistics accumulator; all of them (bar 'mcAmericanBasketEngine', see its own doc comment)
-- take an explicit 'StatisticsTrait' argument for the latter, letting the caller pick
-- 'Statistics'\/'GaussianStatistics'\/'GeneralStatistics'\/'IncrementalStatistics' instead of being
-- pinned to upstream's default @Statistics@.
mcHestonHullWhiteEngine :: (RngTrait) -> (StatisticsTrait) -> (HybridHestonHullWhiteProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timStepsPerYear
 -> (Bool) -- ^antitheticVariate
 -> (Bool) -- ^controlVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcHestonHullWhiteEngine :: RngTrait
-> StatisticsTrait
-> HybridHestonHullWhiteProcess
-> Maybe Word
-> Maybe Word
-> Bool
-> Bool
-> Maybe Word
-> Maybe Double
-> Maybe Word
-> Word
-> IO PricingEngine
mcHestonHullWhiteEngine RngTrait
a1 StatisticsTrait
a2 HybridHestonHullWhiteProcess
a3 Maybe Word
a4 Maybe Word
a5 Bool
a6 Bool
a7 Maybe Word
a8 Maybe Double
a9 Maybe Word
a10 Word
a11 =
  let {a1' :: CInt
a1' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (RngTrait -> Int) -> RngTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RngTrait -> Int
forall a. Enum a => a -> Int
fromEnum) RngTrait
a1} in 
  let {a2' :: CInt
a2' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (StatisticsTrait -> Int) -> StatisticsTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StatisticsTrait -> Int
forall a. Enum a => a -> Int
fromEnum) StatisticsTrait
a2} in 
  HybridHestonHullWhiteProcess
-> (Ptr CHybridHestonHullWhiteProcess' -> IO PricingEngine)
-> IO PricingEngine
forall p b.
GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess HybridHestonHullWhiteProcess
a3 ((Ptr CHybridHestonHullWhiteProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CHybridHestonHullWhiteProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHybridHestonHullWhiteProcess'
a3' -> 
  let {a4' :: CUInt
a4' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a4} in 
  let {a5' :: CUInt
a5' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a5} in 
  let {a6' :: CInt
a6' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a6} in 
  let {a7' :: CInt
a7' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a7} in 
  let {a8' :: CUInt
a8' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a8} in 
  let {a9' :: CDouble
a9' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a9} in 
  let {a10' :: CUInt
a10' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a10} in 
  let {a11' :: CUInt
a11' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a11} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a12' -> 
  CInt
-> CInt
-> Ptr CHybridHestonHullWhiteProcess'
-> CUInt
-> CUInt
-> CInt
-> CInt
-> CUInt
-> CDouble
-> CUInt
-> CUInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
mcHestonHullWhiteEngine'_ CInt
a1' CInt
a2' Ptr CHybridHestonHullWhiteProcess'
a3' CUInt
a4' CUInt
a5' CInt
a6' CInt
a7' CUInt
a8' CDouble
a9' CUInt
a10' CUInt
a11' Ptr (Ptr CChar)
a12' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a12'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1313 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo (least-squares) pricing engine for American options
mcAmericanEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^antitheticVariate
 -> (Bool) -- ^controlVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> (Word) -- ^polynomOrder
 -> (PolynomialType) -> (Maybe Word) -- ^nCalibrationSamples
 -> (Maybe Bool) -- ^antitheticVariateCalibration
 -> (Maybe Word) -- ^seedCalibration
 -> IO ((PricingEngine))
mcAmericanEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  let {a12' = fromIntegral a12} in 
  let {a13' = (fromIntegral . fromEnum) a13} in 
  let {a14' = fromMaybeInt a14} in 
  let {a15' = fromMaybeBool a15} in 
  let {a16' = fromMaybeInt a16} in 
  preErrorCheck $ \a17' -> 
  mcAmericanEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' a17' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a17'>>
  return (res')

{-# LINE 1328 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for barrier options
mcBarrierEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Bool) -- ^isBiased
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = C2HSImp.fromBool a11} in 
  let {a12' = fromIntegral a12} in 
  preErrorCheck $ \a13' -> 
  mcBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a13'>>
  return (res')

{-# LINE 1340 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for digital (cash-or-nothing/asset-or-nothing) options
mcDigitalEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -> (Bool) -> (Bool) -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcDigitalEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcDigitalEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1351 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for discrete arithmetic average-price Asian options
mcDiscreteArithmeticApEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Bool) -- ^controlVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcDiscreteArithmeticApEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = fromMaybeInt a7} in 
  let {a8' = fromMaybeDouble a8} in 
  let {a9' = fromMaybeInt a9} in 
  let {a10' = fromIntegral a10} in 
  preErrorCheck $ \a11' -> 
  mcDiscreteArithmeticApEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a11'>>
  return (res')

{-# LINE 1361 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for discrete arithmetic average-strike Asian options
mcDiscreteArithmeticAsEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcDiscreteArithmeticAsEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = fromMaybeInt a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromIntegral a9} in 
  preErrorCheck $ \a10' -> 
  mcDiscreteArithmeticAsEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1370 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for discrete geometric average-price Asian options
mcDiscreteGeometricApEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcDiscreteGeometricApEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = fromMaybeInt a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromIntegral a9} in 
  preErrorCheck $ \a10' -> 
  mcDiscreteGeometricApEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1379 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for discrete arithmetic average-price Asian options under the
-- Heston stochastic-volatility model.  Uses one time step per fixing date unless /timeSteps/ or
-- /timeStepsPerYear/ overrides the grid. When /controlVariate/ is true, prices the same path
-- against 'analyticDiscreteGeometricAveragePriceAsianHestonEngine' as a control variate.
mcDiscreteArithmeticApHestonEngine :: (RngTrait) -> (StatisticsTrait) -> (GenHestonProcess hp) -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^controlVariate
 -> IO ((PricingEngine))
mcDiscreteArithmeticApHestonEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withHestonProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = fromMaybeDouble a6} in 
  let {a7' = fromMaybeInt a7} in 
  let {a8' = fromIntegral a8} in 
  let {a9' = fromMaybeInt a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = C2HSImp.fromBool a11} in 
  preErrorCheck $ \a12' -> 
  mcDiscreteArithmeticApHestonEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1394 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for discrete geometric average-price Asian options under the
-- Heston stochastic-volatility model.  Uses one time step per fixing date unless /timeSteps/ or
-- /timeStepsPerYear/ overrides the grid.
mcDiscreteGeometricApHestonEngine :: (RngTrait) -> (StatisticsTrait) -> (GenHestonProcess hp) -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> IO ((PricingEngine))
mcDiscreteGeometricApHestonEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withHestonProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = fromMaybeDouble a6} in 
  let {a7' = fromMaybeInt a7} in 
  let {a8' = fromIntegral a8} in 
  let {a9' = fromMaybeInt a9} in 
  let {a10' = fromMaybeInt a10} in 
  preErrorCheck $ \a11' -> 
  mcDiscreteGeometricApHestonEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a11'>>
  return (res')

{-# LINE 1407 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for European options under a Black-Scholes process
mcEuropeanEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcEuropeanEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcEuropeanEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1418 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for European options under a GJR-GARCH process
mcEuropeanGjrGarchEngine :: (RngTrait) -> (StatisticsTrait) -> (GJRGARCHProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcEuropeanGjrGarchEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGenStochasticProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = fromMaybeInt a7} in 
  let {a8' = fromMaybeDouble a8} in 
  let {a9' = fromMaybeInt a9} in 
  let {a10' = fromIntegral a10} in 
  preErrorCheck $ \a11' -> 
  mcEuropeanGjrGarchEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a11'>>
  return (res')

{-# LINE 1428 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for European options under a Heston process
mcEuropeanHestonEngine :: (RngTrait) -> (StatisticsTrait) -> (GenHestonProcess hp) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcEuropeanHestonEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withHestonProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = fromMaybeInt a7} in 
  let {a8' = fromMaybeDouble a8} in 
  let {a9' = fromMaybeInt a9} in 
  let {a10' = fromIntegral a10} in 
  preErrorCheck $ \a11' -> 
  mcEuropeanHestonEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a11'>>
  return (res')

{-# LINE 1438 "./QuantLib/PricingEngine.chs" #-}


-- |Prices a 'VarianceOption' by integrating its payoff against the Heston-model transition density.
integralHestonVarianceOptionEngine :: (GenHestonProcess hp) -> IO ((PricingEngine))
integralHestonVarianceOptionEngine a1 =
  withHestonProcess a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  integralHestonVarianceOptionEngine'_ a1' a2' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 1441 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo Hull-White pricing engine for caps\/floors
mcHullWhiteCapFloorEngine :: (RngTrait) -> (StatisticsTrait) -> (HullWhite) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcHullWhiteCapFloorEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withHullWhite a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = fromMaybeInt a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromIntegral a9} in 
  preErrorCheck $ \a10' -> 
  mcHullWhiteCapFloorEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1450 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for 'himalayaOption'
mcHimalayaEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcHimalayaEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGenStochasticProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = fromMaybeInt a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromIntegral a9} in 
  preErrorCheck $ \a10' -> 
  mcHimalayaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1459 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for 'pagodaOption'
mcPagodaEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcPagodaEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGenStochasticProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = fromMaybeInt a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromIntegral a9} in 
  preErrorCheck $ \a10' -> 
  mcPagodaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1468 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for a European 'basketOption'.
mcEuropeanBasketEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcEuropeanBasketEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGenStochasticProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcEuropeanBasketEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1479 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for 'everestOption'. Exactly one of @timeSteps@\/@timeStepsPerYear@ must be given.
mcEverestEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcEverestEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGenStochasticProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcEverestEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1490 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo (least-squares) pricing engine for an American 'basketOption'. /NB/ unlike every
-- other MC engine in this module, this one has no 'StatisticsTrait' parameter: upstream's
-- @MCAmericanBasketEngine\<RNG\>@ is templated on @RNG@ only -- its base
-- @MCLongstaffSchwartzEngine\<BasketOption::engine,MultiVariate,RNG\>@ never forwards a second
-- template argument, so there is no @S@ to expose here (a real upstream limitation, not an
-- oversight).
mcAmericanBasketEngine :: (RngTrait) -> (StochasticProcessArray) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> (Maybe Word) -- ^nCalibrationSamples
 -> (Word) -- ^polynomialOrder
 -> (PolynomialType) -- ^polynomialType
 -> IO ((PricingEngine))
mcAmericanBasketEngine :: RngTrait
-> StochasticProcessArray
-> Maybe Word
-> Maybe Word
-> Bool
-> Bool
-> Maybe Word
-> Maybe Double
-> Maybe Word
-> Word
-> Maybe Word
-> Word
-> PolynomialType
-> IO PricingEngine
mcAmericanBasketEngine RngTrait
a1 StochasticProcessArray
a2 Maybe Word
a3 Maybe Word
a4 Bool
a5 Bool
a6 Maybe Word
a7 Maybe Double
a8 Maybe Word
a9 Word
a10 Maybe Word
a11 Word
a12 PolynomialType
a13 =
  let {a1' :: CInt
a1' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (RngTrait -> Int) -> RngTrait -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RngTrait -> Int
forall a. Enum a => a -> Int
fromEnum) RngTrait
a1} in 
  StochasticProcessArray
-> (Ptr CStochasticProcessArray' -> IO PricingEngine)
-> IO PricingEngine
forall p b.
GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess StochasticProcessArray
a2 ((Ptr CStochasticProcessArray' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CStochasticProcessArray' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CStochasticProcessArray'
a2' -> 
  let {a3' :: CUInt
a3' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a3} in 
  let {a4' :: CUInt
a4' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a4} in 
  let {a5' :: CInt
a5' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a5} in 
  let {a6' :: CInt
a6' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a6} in 
  let {a7' :: CUInt
a7' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a7} in 
  let {a8' :: CDouble
a8' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a8} in 
  let {a9' :: CUInt
a9' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a9} in 
  let {a10' :: CUInt
a10' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a10} in 
  let {a11' :: CUInt
a11' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a11} in 
  let {a12' :: CUInt
a12' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a12} in 
  let {a13' :: CInt
a13' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (PolynomialType -> Int) -> PolynomialType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PolynomialType -> Int
forall a. Enum a => a -> Int
fromEnum) PolynomialType
a13} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a14' -> 
  CInt
-> Ptr CStochasticProcessArray'
-> CUInt
-> CUInt
-> CInt
-> CInt
-> CUInt
-> CDouble
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
mcAmericanBasketEngine'_ CInt
a1' Ptr CStochasticProcessArray'
a2' CUInt
a3' CUInt
a4' CInt
a5' CInt
a6' CUInt
a7' CDouble
a8' CUInt
a9' CUInt
a10' CUInt
a11' CUInt
a12' CInt
a13' Ptr (Ptr CChar)
a14' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a14'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1509 "./QuantLib/PricingEngine.chs" #-}


-- |Monte Carlo pricing engine for performance (return) options
mcPerformanceEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcPerformanceEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  let {a6' = fromMaybeInt a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromIntegral a9} in 
  preErrorCheck $ \a10' -> 
  mcPerformanceEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1518 "./QuantLib/PricingEngine.chs" #-}


-- |variance-swap pricing engine using Monte Carlo simulation (see the note above
-- 'mcHestonHullWhiteEngine' for the 'StatisticsTrait' parameter shared by every MC engine here).
mcVarianceSwapEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 -> (Maybe Word) -- ^timeStepsPerYear
 -> (Bool) -- ^brownianBridge
 -> (Bool) -- ^antitheticVariate
 -> (Maybe Word) -- ^requiredSamples
 -> (Maybe Double) -- ^requiredTolerance
 -> (Maybe Word) -- ^maxSamples
 -> (Word) -- ^seed
 -> IO ((PricingEngine))
mcVarianceSwapEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  let {a4' = fromMaybeInt a4} in 
  let {a5' = fromMaybeInt a5} in 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = fromMaybeInt a8} in 
  let {a9' = fromMaybeDouble a9} in 
  let {a10' = fromMaybeInt a10} in 
  let {a11' = fromIntegral a11} in 
  preErrorCheck $ \a12' -> 
  mcVarianceSwapEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1530 "./QuantLib/PricingEngine.chs" #-}


-- |pricing engine for vanilla options using binomial trees
binomialVanillaEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 -> IO ((PricingEngine))
binomialVanillaEngine a1 a2 a3 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  binomialVanillaEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1534 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Black-Scholes pricing engine for discrete-averaging Asian options
fdBlackScholesAsianEngine :: (GeneralizedBlackScholesProcess) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^aGrid
 -> (FdmScheme) -> IO ((PricingEngine))
fdBlackScholesAsianEngine a1 a2 a3 a4 a5 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  withFdmSchemeDesc a5 $ \a5' -> 
  preErrorCheck $ \a6' -> 
  fdBlackScholesAsianEngine'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 1541 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Black-Scholes pricing engine for vanilla options
fdBlackScholesVanillaEngineNoDividends :: (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 -> (Word) -- ^gridPoints
 -> (Word) -- ^timeDependent
 -> (FdmScheme) -> (Bool) -- ^localVol
 -> (Double) -- ^illegalLocalVolOverwrite
 -> (CashDividendModel) -- ^cashDividendModel
 -> IO ((PricingEngine))
fdBlackScholesVanillaEngineNoDividends a1 a2 a3 a4 a5 a6 a7 a8 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  withFdmSchemeDesc a5 $ \a5' -> 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = realToFrac a7} in 
  let {a8' = (fromIntegral . fromEnum) a8} in 
  preErrorCheck $ \a9' -> 
  fdBlackScholesVanillaEngineNoDividends'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 1551 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Black-Scholes pricing engine for vanilla options, with discrete dividends
fdBlackScholesVanillaEngineWithDividends :: (GeneralizedBlackScholesProcess) -> ([Dividend]) -> (Word) -- ^timeSteps
 -> (Word) -- ^gridPoints
 -> (Word) -- ^timeDependent
 -> (FdmScheme) -> (Bool) -- ^localVol
 -> (Double) -- ^illegalLocalVolOverwrite
 -> (CashDividendModel) -- ^cashDividendModel
 -> IO ((PricingEngine))
fdBlackScholesVanillaEngineWithDividends a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  withFdmSchemeDesc a6 $ \a6' -> 
  let {a7' = C2HSImp.fromBool a7} in 
  let {a8' = realToFrac a8} in 
  let {a9' = (fromIntegral . fromEnum) a9} in 
  preErrorCheck $ \a10' -> 
  fdBlackScholesVanillaEngineWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1562 "./QuantLib/PricingEngine.chs" #-}


-- |Finite-difference Black-Scholes vanilla engine; @[]@ selects no-dividend behavior.
fdBlackScholesVanillaEngine :: GeneralizedBlackScholesProcess -> [Dividend] -> Word -> Word -> Word
  -> FdmScheme -> Bool -> Double -> CashDividendModel -> IO PricingEngine
fdBlackScholesVanillaEngine process dividends =
  case dividends of
    [] -> fdBlackScholesVanillaEngineNoDividends process
    _ -> fdBlackScholesVanillaEngineWithDividends process dividends

-- |finite-differences Black-Scholes pricing engine for vanilla options, with quanto adjustment
fdBlackScholesVanillaEngineQuantoNoDividends :: (GeneralizedBlackScholesProcess) -> (Maybe FdmQuantoHelper) -> (Word) -- ^timeSteps
 -> (Word) -- ^gridPoints
 -> (Word) -- ^timeDependent
 -> (FdmScheme) -> (Bool) -- ^localVol
 -> (Double) -- ^illegalLocalVolOverwrite
 -> (CashDividendModel) -- ^cashDividendModel
 -> IO ((PricingEngine))
fdBlackScholesVanillaEngineQuantoNoDividends :: GeneralizedBlackScholesProcess
-> Maybe FdmQuantoHelper
-> Word
-> Word
-> Word
-> FdmScheme
-> Bool
-> Double
-> CashDividendModel
-> IO PricingEngine
fdBlackScholesVanillaEngineQuantoNoDividends GeneralizedBlackScholesProcess
a1 Maybe FdmQuantoHelper
a2 Word
a3 Word
a4 Word
a5 FdmScheme
a6 Bool
a7 Double
a8 CashDividendModel
a9 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  Maybe FdmQuantoHelper
-> (Ptr CFdmQuantoHelper -> IO PricingEngine) -> IO PricingEngine
forall b.
Maybe FdmQuantoHelper -> (Ptr CFdmQuantoHelper -> IO b) -> IO b
withMaybeFdmQuantoHelper Maybe FdmQuantoHelper
a2 ((Ptr CFdmQuantoHelper -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmQuantoHelper -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmQuantoHelper
a2' -> 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a6 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a6' -> 
  let {a7' :: CInt
a7' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a7} in 
  let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in 
  let {a9' :: CInt
a9' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (CashDividendModel -> Int) -> CashDividendModel -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CashDividendModel -> Int
forall a. Enum a => a -> Int
fromEnum) CashDividendModel
a9} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> Ptr CFdmQuantoHelper
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> CInt
-> CDouble
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fdBlackScholesVanillaEngineQuantoNoDividends'_ Ptr CGeneralizedBlackScholesProcess'
a1' Ptr CFdmQuantoHelper
a2' CUInt
a3' CUInt
a4' CUInt
a5' Ptr CFdmSchemeDesc
a6' CInt
a7' CDouble
a8' CInt
a9' Ptr (Ptr CChar)
a10' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a10'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1581 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Black-Scholes pricing engine for vanilla options, with discrete dividends and quanto adjustment
fdBlackScholesVanillaEngineQuantoWithDividends :: (GeneralizedBlackScholesProcess) -> ([Dividend]) -> (Maybe FdmQuantoHelper) -> (Word) -- ^timeSteps
 -> (Word) -- ^gridPoints
 -> (Word) -- ^timeDependent
 -> (FdmScheme) -> (Bool) -- ^localVol
 -> (Double) -- ^illegalLocalVolOverwrite
 -> (CashDividendModel) -- ^cashDividendModel
 -> IO ((PricingEngine))
fdBlackScholesVanillaEngineQuantoWithDividends a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  withMaybeFdmQuantoHelper a3 $ \a3' -> 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = fromIntegral a6} in 
  withFdmSchemeDesc a7 $ \a7' -> 
  let {a8' = C2HSImp.fromBool a8} in 
  let {a9' = realToFrac a9} in 
  let {a10' = (fromIntegral . fromEnum) a10} in 
  preErrorCheck $ \a11' -> 
  fdBlackScholesVanillaEngineQuantoWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a11'>>
  return (res')

{-# LINE 1592 "./QuantLib/PricingEngine.chs" #-}


-- |Quanto-adjusted Black-Scholes vanilla engine; @[]@ selects no-dividend behavior.
fdBlackScholesVanillaEngineQuanto :: GeneralizedBlackScholesProcess -> [Dividend]
  -> Maybe FdmQuantoHelper -> Word -> Word -> Word -> FdmScheme -> Bool -> Double
  -> CashDividendModel -> IO PricingEngine
fdBlackScholesVanillaEngineQuanto process dividends =
  case dividends of
    [] -> fdBlackScholesVanillaEngineQuantoNoDividends process
    _ -> fdBlackScholesVanillaEngineQuantoWithDividends process dividends

-- |finite-differences Heston-model pricing engine for vanilla options
fdHestonVanillaEngineNoDividends :: (GenHestonModel hm) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonVanillaEngineNoDividends :: forall hm lv.
GenHestonModel hm
-> Word
-> Word
-> Word
-> Word
-> FdmScheme
-> Maybe (GenLocalVolTermStructure lv)
-> Double
-> IO PricingEngine
fdHestonVanillaEngineNoDividends GenHestonModel hm
a1 Word
a2 Word
a3 Word
a4 Word
a5 FdmScheme
a6 Maybe (GenLocalVolTermStructure lv)
a7 Double
a8 =
  GenHestonModel hm
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a1 ((Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a1' -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a6 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a6' -> 
  Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall lv b.
Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withMaybeLocalVolTermStructure Maybe (GenLocalVolTermStructure lv)
a7 ((Ptr CLocalVolTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CLocalVolTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CLocalVolTermStructure'
a7' -> 
  let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a9' -> 
  Ptr CHestonModel'
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> Ptr CLocalVolTermStructure'
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fdHestonVanillaEngineNoDividends'_ Ptr CHestonModel'
a1' CUInt
a2' CUInt
a3' CUInt
a4' CUInt
a5' Ptr CFdmSchemeDesc
a6' Ptr CLocalVolTermStructure'
a7' CDouble
a8' Ptr (Ptr CChar)
a9' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a9'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1611 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Heston-model pricing engine for vanilla options, with discrete dividends
fdHestonVanillaEngineWithDividends :: (GenHestonModel hm) -> ([Dividend]) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonVanillaEngineWithDividends a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  withHestonModel a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = fromIntegral a6} in 
  withFdmSchemeDesc a7 $ \a7' -> 
  withMaybeLocalVolTermStructure a8 $ \a8' -> 
  let {a9' = realToFrac a9} in 
  preErrorCheck $ \a10' -> 
  fdHestonVanillaEngineWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a10'>>
  return (res')

{-# LINE 1622 "./QuantLib/PricingEngine.chs" #-}


-- |Finite-difference Heston vanilla engine; @[]@ selects no-dividend behavior.
fdHestonVanillaEngine :: GenHestonModel hm -> [Dividend] -> Word -> Word -> Word -> Word
  -> FdmScheme -> Maybe (GenLocalVolTermStructure lv) -> Double -> IO PricingEngine
fdHestonVanillaEngine model dividends =
  case dividends of
    [] -> fdHestonVanillaEngineNoDividends model
    _ -> fdHestonVanillaEngineWithDividends model dividends

-- |Fourier-cosine-series Heston engine for European vanilla options. @L@ controls the truncation range and @n@ the number of cosine terms.
cosHestonEngine :: (GenHestonModel hm) -- ^model
 -> (Double) -- ^L
 -> (Word) -- ^n
 -> IO ((PricingEngine))
cosHestonEngine :: forall hm. GenHestonModel hm -> Double -> Word -> IO PricingEngine
cosHestonEngine GenHestonModel hm
a1 Double
a2 Word
a3 =
  GenHestonModel hm
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a1 ((Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a1' -> 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' -> 
  Ptr CHestonModel'
-> CDouble -> CUInt -> Ptr (Ptr CChar) -> IO (Ptr CPricingEngine)
cosHestonEngine'_ Ptr CHestonModel'
a1' CDouble
a2' CUInt
a3' Ptr (Ptr CChar)
a4' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a4'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1636 "./QuantLib/PricingEngine.chs" #-}


-- |Heston transition-density integration engine for European vanilla options. @eps@ and @integrationOrder@ control Gauss-Lobatto integration accuracy and its iteration limit.
analyticPdfHestonEngine :: (GenHestonModel hm) -- ^model
 -> (Double) -- ^eps
 -> (Word) -- ^integrationOrder
 -> IO ((PricingEngine))
analyticPdfHestonEngine a1 a2 a3 =
  withHestonModel a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = fromIntegral a3} in 
  preErrorCheck $ \a4' -> 
  analyticPdfHestonEngine'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1642 "./QuantLib/PricingEngine.chs" #-}


-- |Partial-integro finite-difference Bates-model engine for vanilla options.
fdBatesVanillaEngineNoDividends :: (GenBatesModel bm) -- ^model
 -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -- ^schemeDesc
 -> IO ((PricingEngine))
fdBatesVanillaEngineNoDividends a1 a2 a3 a4 a5 a6 =
  withBatesModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  withFdmSchemeDesc a6 $ \a6' -> 
  preErrorCheck $ \a7' -> 
  fdBatesVanillaEngineNoDividends'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 1651 "./QuantLib/PricingEngine.chs" #-}


-- |Partial-integro finite-difference Bates-model engine for vanilla options with discrete dividends.
fdBatesVanillaEngineWithDividends :: (GenBatesModel bm) -- ^model
 -> ([Dividend]) -- ^dividends
 -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -- ^schemeDesc
 -> IO ((PricingEngine))
fdBatesVanillaEngineWithDividends a1 a2 a3 a4 a5 a6 a7 =
  withBatesModel a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = fromIntegral a6} in 
  withFdmSchemeDesc a7 $ \a7' -> 
  preErrorCheck $ \a8' -> 
  fdBatesVanillaEngineWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a8'>>
  return (res')

{-# LINE 1661 "./QuantLib/PricingEngine.chs" #-}


-- |Finite-difference Bates vanilla engine; @[]@ selects no-dividend behavior.
fdBatesVanillaEngine :: GenBatesModel bm -> [Dividend] -> Word -> Word -> Word -> Word
  -> FdmScheme -> IO PricingEngine
fdBatesVanillaEngine model dividends =
  case dividends of
    [] -> fdBatesVanillaEngineNoDividends model
    _ -> fdBatesVanillaEngineWithDividends model dividends

-- |Finite-difference Black-Scholes engine for American shout options.
fdBlackScholesShoutEngineNoDividends :: (GeneralizedBlackScholesProcess) -- ^process
 -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -- ^schemeDesc
 -> IO ((PricingEngine))
fdBlackScholesShoutEngineNoDividends :: GeneralizedBlackScholesProcess
-> Word -> Word -> Word -> FdmScheme -> IO PricingEngine
fdBlackScholesShoutEngineNoDividends GeneralizedBlackScholesProcess
a1 Word
a2 Word
a3 Word
a4 FdmScheme
a5 =
  GeneralizedBlackScholesProcess
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GeneralizedBlackScholesProcess
a1 ((Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a1' -> 
  let {a2' :: CUInt
a2' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a2} in 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a5 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a5' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a6' -> 
  Ptr CGeneralizedBlackScholesProcess'
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fdBlackScholesShoutEngineNoDividends'_ Ptr CGeneralizedBlackScholesProcess'
a1' CUInt
a2' CUInt
a3' CUInt
a4' Ptr CFdmSchemeDesc
a5' Ptr (Ptr CChar)
a6' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a6'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1677 "./QuantLib/PricingEngine.chs" #-}


-- |Finite-difference Black-Scholes engine for American shout options with discrete dividends.
fdBlackScholesShoutEngineWithDividends :: (GeneralizedBlackScholesProcess) -- ^process
 -> ([Dividend]) -- ^dividends
 -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -- ^schemeDesc
 -> IO ((PricingEngine))
fdBlackScholesShoutEngineWithDividends a1 a2 a3 a4 a5 a6 =
  withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  withFdmSchemeDesc a6 $ \a6' -> 
  preErrorCheck $ \a7' -> 
  fdBlackScholesShoutEngineWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 1686 "./QuantLib/PricingEngine.chs" #-}


-- |Finite-difference Black-Scholes shout engine; @[]@ selects no-dividend behavior.
fdBlackScholesShoutEngine :: GeneralizedBlackScholesProcess -> [Dividend] -> Word -> Word
  -> Word -> FdmScheme -> IO PricingEngine
fdBlackScholesShoutEngine process dividends =
  case dividends of
    [] -> fdBlackScholesShoutEngineNoDividends process
    _ -> fdBlackScholesShoutEngineWithDividends process dividends

-- |finite-differences Heston-model pricing engine for vanilla options, with quanto adjustment
fdHestonVanillaEngineQuantoNoDividends :: (GenHestonModel hm) -> (Maybe FdmQuantoHelper) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonVanillaEngineQuantoNoDividends :: forall hm lv.
GenHestonModel hm
-> Maybe FdmQuantoHelper
-> Word
-> Word
-> Word
-> Word
-> FdmScheme
-> Maybe (GenLocalVolTermStructure lv)
-> Double
-> IO PricingEngine
fdHestonVanillaEngineQuantoNoDividends GenHestonModel hm
a1 Maybe FdmQuantoHelper
a2 Word
a3 Word
a4 Word
a5 Word
a6 FdmScheme
a7 Maybe (GenLocalVolTermStructure lv)
a8 Double
a9 =
  GenHestonModel hm
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a1 ((Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a1' -> 
  Maybe FdmQuantoHelper
-> (Ptr CFdmQuantoHelper -> IO PricingEngine) -> IO PricingEngine
forall b.
Maybe FdmQuantoHelper -> (Ptr CFdmQuantoHelper -> IO b) -> IO b
withMaybeFdmQuantoHelper Maybe FdmQuantoHelper
a2 ((Ptr CFdmQuantoHelper -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmQuantoHelper -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmQuantoHelper
a2' -> 
  let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a7 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a7' -> 
  Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall lv b.
Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withMaybeLocalVolTermStructure Maybe (GenLocalVolTermStructure lv)
a8 ((Ptr CLocalVolTermStructure' -> IO PricingEngine)
 -> IO PricingEngine)
-> (Ptr CLocalVolTermStructure' -> IO PricingEngine)
-> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CLocalVolTermStructure'
a8' -> 
  let {a9' :: CDouble
a9' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a9} in 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' -> 
  Ptr CHestonModel'
-> Ptr CFdmQuantoHelper
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> Ptr CFdmSchemeDesc
-> Ptr CLocalVolTermStructure'
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fdHestonVanillaEngineQuantoNoDividends'_ Ptr CHestonModel'
a1' Ptr CFdmQuantoHelper
a2' CUInt
a3' CUInt
a4' CUInt
a5' CUInt
a6' Ptr CFdmSchemeDesc
a7' Ptr CLocalVolTermStructure'
a8' CDouble
a9' Ptr (Ptr CChar)
a10' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a10'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1705 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences Heston-model pricing engine for vanilla options, with discrete dividends and quanto adjustment
fdHestonVanillaEngineQuantoWithDividends :: (GenHestonModel hm) -> ([Dividend]) -> (Maybe FdmQuantoHelper) -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^dampingSteps
 -> (FdmScheme) -> (Maybe (GenLocalVolTermStructure lv)) -- ^leverageFct
 -> (Double) -- ^mixingFactor, upstream default: 1.0
 -> IO ((PricingEngine))
fdHestonVanillaEngineQuantoWithDividends a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  withHestonModel a1 $ \a1' -> 
  withDividendArray a2 $ \(a2'1, a2'2) -> 
  withMaybeFdmQuantoHelper a3 $ \a3' -> 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = fromIntegral a6} in 
  let {a7' = fromIntegral a7} in 
  withFdmSchemeDesc a8 $ \a8' -> 
  withMaybeLocalVolTermStructure a9 $ \a9' -> 
  let {a10' = realToFrac a10} in 
  preErrorCheck $ \a11' -> 
  fdHestonVanillaEngineQuantoWithDividends'_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a11'>>
  return (res')

{-# LINE 1716 "./QuantLib/PricingEngine.chs" #-}


-- |Quanto-adjusted Heston vanilla engine; @[]@ selects no-dividend behavior.
fdHestonVanillaEngineQuanto :: GenHestonModel hm -> [Dividend] -> Maybe FdmQuantoHelper
  -> Word -> Word -> Word -> Word -> FdmScheme -> Maybe (GenLocalVolTermStructure lv)
  -> Double -> IO PricingEngine
fdHestonVanillaEngineQuanto model dividends =
  case dividends of
    [] -> fdHestonVanillaEngineQuantoNoDividends model
    _ -> fdHestonVanillaEngineQuantoWithDividends model dividends

-- |finite-differences pricing engine for vanilla options combining a Heston equity model with a Hull-White short-rate model
fdHestonHullWhiteVanillaEngineNoDividends :: (GenHestonModel hm) -> (HullWhiteProcess) -> (Double) -- ^corrEquityShortRate
 -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^rGrid
 -> (Word) -- ^dampingSteps
 -> (Bool) -- ^controlVariate, upstream default: true
 -> (FdmScheme) -> IO ((PricingEngine))
fdHestonHullWhiteVanillaEngineNoDividends :: forall hm.
GenHestonModel hm
-> HullWhiteProcess
-> Double
-> Word
-> Word
-> Word
-> Word
-> Word
-> Bool
-> FdmScheme
-> IO PricingEngine
fdHestonHullWhiteVanillaEngineNoDividends GenHestonModel hm
a1 HullWhiteProcess
a2 Double
a3 Word
a4 Word
a5 Word
a6 Word
a7 Word
a8 Bool
a9 FdmScheme
a10 =
  GenHestonModel hm
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a1 ((Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHestonModel' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a1' -> 
  HullWhiteProcess
-> (Ptr CHullWhiteProcess' -> IO PricingEngine) -> IO PricingEngine
forall p1d b.
GenStochasticProcess1D (ForeignPtr p1d)
-> (Ptr p1d -> IO b) -> IO b
withGenStochasticProcess1D HullWhiteProcess
a2 ((Ptr CHullWhiteProcess' -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CHullWhiteProcess' -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CHullWhiteProcess'
a2' -> 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in 
  let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in 
  let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in 
  let {a7' :: CUInt
a7' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a7} in 
  let {a8' :: CUInt
a8' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a8} in 
  let {a9' :: CInt
a9' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a9} in 
  FdmScheme
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a. FdmScheme -> (Ptr CFdmSchemeDesc -> IO a) -> IO a
withFdmSchemeDesc FdmScheme
a10 ((Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr CFdmSchemeDesc -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr CFdmSchemeDesc
a10' -> 
  (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine)
-> (Ptr (Ptr CChar) -> IO PricingEngine) -> IO PricingEngine
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a11' -> 
  Ptr CHestonModel'
-> Ptr CHullWhiteProcess'
-> CDouble
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> CUInt
-> CInt
-> Ptr CFdmSchemeDesc
-> Ptr (Ptr CChar)
-> IO (Ptr CPricingEngine)
fdHestonHullWhiteVanillaEngineNoDividends'_ Ptr CHestonModel'
a1' Ptr CHullWhiteProcess'
a2' CDouble
a3' CUInt
a4' CUInt
a5' CUInt
a6' CUInt
a7' CUInt
a8' CInt
a9' Ptr CFdmSchemeDesc
a10' Ptr (Ptr CChar)
a11' IO (Ptr CPricingEngine)
-> (Ptr CPricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CPricingEngine
res ->
  Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine Ptr CPricingEngine
res IO PricingEngine
-> (PricingEngine -> IO PricingEngine) -> IO PricingEngine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \PricingEngine
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a11'IO () -> IO PricingEngine -> IO PricingEngine
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  PricingEngine -> IO PricingEngine
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (PricingEngine
res')

{-# LINE 1737 "./QuantLib/PricingEngine.chs" #-}


-- |finite-differences pricing engine for vanilla options combining a Heston equity model with a Hull-White short-rate model, with discrete dividends
fdHestonHullWhiteVanillaEngineWithDividends :: (GenHestonModel hm) -> (HullWhiteProcess) -> ([Dividend]) -> (Double) -- ^corrEquityShortRate
 -> (Word) -- ^tGrid
 -> (Word) -- ^xGrid
 -> (Word) -- ^vGrid
 -> (Word) -- ^rGrid
 -> (Word) -- ^dampingSteps
 -> (Bool) -- ^controlVariate, upstream default: true
 -> (FdmScheme) -> IO ((PricingEngine))
fdHestonHullWhiteVanillaEngineWithDividends a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  withHestonModel a1 $ \a1' -> 
  withGenStochasticProcess1D a2 $ \a2' -> 
  withDividendArray a3 $ \(a3'1, a3'2) -> 
  let {a4' = realToFrac a4} in 
  let {a5' = fromIntegral a5} in 
  let {a6' = fromIntegral a6} in 
  let {a7' = fromIntegral a7} in 
  let {a8' = fromIntegral a8} in 
  let {a9' = fromIntegral a9} in 
  let {a10' = C2HSImp.fromBool a10} in 
  withFdmSchemeDesc a11 $ \a11' -> 
  preErrorCheck $ \a12' -> 
  fdHestonHullWhiteVanillaEngineWithDividends'_ a1' a2' a3'1  a3'2 a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 1749 "./QuantLib/PricingEngine.chs" #-}


-- |Heston/Hull-White finite-difference engine; @[]@ selects no-dividend behavior.
fdHestonHullWhiteVanillaEngine :: GenHestonModel hm -> HullWhiteProcess -> [Dividend]
  -> Double -> Word -> Word -> Word -> Word -> Word -> Bool -> FdmScheme -> IO PricingEngine
fdHestonHullWhiteVanillaEngine heston hullWhite dividends =
  case dividends of
    [] -> fdHestonHullWhiteVanillaEngineNoDividends heston hullWhite
    _ -> fdHestonHullWhiteVanillaEngineWithDividends heston hullWhite dividends

-- |binomial Tsiveriotis-Fernandes pricing engine for convertible bonds
binomialConvertibleEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 -> (GenQuote q) -- ^creditSpread
 -> ([Dividend]) -- ^dividends
 -> IO ((PricingEngine))
binomialConvertibleEngine a1 a2 a3 a4 a5 =
  let {a1' = (fromIntegral . fromEnum) a1} in 
  withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  let {a3' = fromIntegral a3} in 
  withQuote a4 $ \a4' -> 
  withDividendArray a5 $ \(a5'1, a5'2) -> 
  preErrorCheck $ \a6' -> 
  binomialConvertibleEngine'_ a1' a2' a3' a4' a5'1  a5'2 a6' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 1764 "./QuantLib/PricingEngine.chs" #-}


-- |volatility is the quoted fwd yield volatility, not price vol
blackCallableFixedRateBondEngineFromVolatilityStructure :: (CallableBondVolatilityStructure) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
blackCallableFixedRateBondEngineFromVolatilityStructure a1 a2 =
  withGenTermStructure a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  blackCallableFixedRateBondEngineFromVolatilityStructure'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1767 "./QuantLib/PricingEngine.chs" #-}


-- |volatility is the quoted fwd yield volatility, not price vol
blackCallableFixedRateBondEngine :: (GenQuote q) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
blackCallableFixedRateBondEngine a1 a2 =
  withQuote a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  blackCallableFixedRateBondEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1770 "./QuantLib/PricingEngine.chs" #-}


-- |volatility is the quoted fwd yield volatility, not price vol
blackCallableZeroCouponBondEngineFromVolatilityStructure :: (CallableBondVolatilityStructure) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
blackCallableZeroCouponBondEngineFromVolatilityStructure a1 a2 =
  withGenTermStructure a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  blackCallableZeroCouponBondEngineFromVolatilityStructure'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1773 "./QuantLib/PricingEngine.chs" #-}


-- |volatility is the quoted fwd yield volatility, not price vol
blackCallableZeroCouponBondEngine :: (GenQuote q) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
blackCallableZeroCouponBondEngine a1 a2 =
  withQuote a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  blackCallableZeroCouponBondEngine'_ a1' a2' a3' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 1776 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for callable fixed-rate bonds, on an explicit time grid
treeCallableFixedRateBondEngineTimeGrid :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeCallableFixedRateBondEngineTimeGrid a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  withTimeGrid a2 $ \a2' -> 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeCallableFixedRateBondEngineTimeGrid'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1779 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for callable fixed-rate bonds
treeCallableFixedRateBondEngineTimeSteps :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeCallableFixedRateBondEngineTimeSteps a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeCallableFixedRateBondEngineTimeSteps'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1783 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for callable zero coupon bonds, on an explicit time grid
treeCallableZeroCouponBondEngineTimeGrid :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeCallableZeroCouponBondEngineTimeGrid a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  withTimeGrid a2 $ \a2' -> 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeCallableZeroCouponBondEngineTimeGrid'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1786 "./QuantLib/PricingEngine.chs" #-}


-- |numerical-lattice pricing engine for callable zero coupon bonds
treeCallableZeroCouponBondEngineTimeSteps :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
treeCallableZeroCouponBondEngineTimeSteps a1 a2 a3 =
  withShortRateModel a1 $ \a1' -> 
  let {a2' = fromIntegral a2} in 
  withMaybeYieldTermStructure a3 $ \a3' -> 
  preErrorCheck $ \a4' -> 
  treeCallableZeroCouponBondEngineTimeSteps'_ a1' a2' a3' a4' >>= \res ->
  peekPricingEngine res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 1790 "./QuantLib/PricingEngine.chs" #-}


-- |Callable fixed-rate bond lattice engine using either a step count or an explicit grid.
treeCallableFixedRateBondEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeCallableFixedRateBondEngine model latticeTime curve =
  case latticeTime of
    TimeSteps steps -> treeCallableFixedRateBondEngineTimeSteps model steps curve
    ExplicitTimeGrid grid -> treeCallableFixedRateBondEngineTimeGrid model grid curve

-- |Callable zero-coupon bond lattice engine using either a step count or an explicit grid.
treeCallableZeroCouponBondEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine
treeCallableZeroCouponBondEngine model latticeTime curve =
  case latticeTime of
    TimeSteps steps -> treeCallableZeroCouponBondEngineTimeSteps model steps curve
    ExplicitTimeGrid grid -> treeCallableZeroCouponBondEngineTimeGrid model grid curve

-- |intermediate value N'(d1) (or its sign-flipped equivalent) used internally to derive the calculator's Greeks
qlBlackCalculatorAlpha :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorAlpha :: forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorAlpha GenBlackCalculator bc
a1 =
  GenBlackCalculator bc
-> (Ptr CBlackCalculator' -> IO Double) -> IO Double
forall bc b.
GenBlackCalculator bc -> (Ptr CBlackCalculator' -> IO b) -> IO b
withBlackCalculator GenBlackCalculator bc
a1 ((Ptr CBlackCalculator' -> IO Double) -> IO Double)
-> (Ptr CBlackCalculator' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackCalculator'
a1' -> 
  (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a2' -> 
  Ptr CBlackCalculator' -> Ptr (Ptr CChar) -> IO CDouble
qlBlackCalculatorAlpha'_ Ptr CBlackCalculator'
a1' Ptr (Ptr CChar)
a2' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a2'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 1807 "./QuantLib/PricingEngine.chs" #-}


-- |intermediate value N'(d2) (or its sign-flipped equivalent) used internally to derive the calculator's Greeks
qlBlackCalculatorBeta :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorBeta a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorBeta'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1810 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 option-price calculator, from the option type and strike directly
blackCalculatorAtStrikeRaw :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((BlackCalculator))
blackCalculatorAtStrikeRaw a1 a2 a3 a4 a5 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  blackCalculatorAtStrikeRaw'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  peekBlackCalculator res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 1817 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 option-price calculator, from a striked payoff
blackCalculatorFromPayoffRaw :: (StrikedPayoff) -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((BlackCalculator))
blackCalculatorFromPayoffRaw a1 a2 a3 a4 =
  withStrikedPayoff a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  blackCalculatorFromPayoffRaw'_ a1' a2' a3' a4' a5' >>= \res ->
  peekBlackCalculator res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1824 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to change in the underlying spot price.
qlBlackCalculatorDelta :: (GenBlackCalculator bc) -> (Double) -- ^spot
 -> IO ((Double))
qlBlackCalculatorDelta a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorDelta'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1828 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to change in the underlying forward price.
qlBlackCalculatorDeltaForward :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorDeltaForward a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorDeltaForward'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1831 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to dividend/growth rate.
qlBlackCalculatorDividendRho :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 -> IO ((Double))
qlBlackCalculatorDividendRho a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorDividendRho'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1835 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity in percent to a percent change in the underlying spot price.
qlBlackCalculatorElasticity :: (GenBlackCalculator bc) -> (Double) -- ^spot
 -> IO ((Double))
qlBlackCalculatorElasticity a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorElasticity'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1839 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity in percent to a percent change in the underlying forward price.
qlBlackCalculatorElasticityForward :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorElasticityForward a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorElasticityForward'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1842 "./QuantLib/PricingEngine.chs" #-}


-- |Second order derivative with respect to change in the underlying spot price.
qlBlackCalculatorGamma :: (GenBlackCalculator bc) -> (Double) -- ^spot
 -> IO ((Double))
qlBlackCalculatorGamma a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorGamma'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1846 "./QuantLib/PricingEngine.chs" #-}


-- |Second order derivative with respect to change in the underlying forward price.
qlBlackCalculatorGammaForward :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorGammaForward a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorGammaForward'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1849 "./QuantLib/PricingEngine.chs" #-}


-- |Probability of being in the money in the asset martingale measure, i.e. N(d1). It is a risk-neutral probability, not the real world one.
qlBlackCalculatorItmAssetProbability :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorItmAssetProbability a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorItmAssetProbability'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1852 "./QuantLib/PricingEngine.chs" #-}


-- |Probability of being in the money in the bond martingale measure, i.e. N(d2). It is a risk-neutral probability, not the real world one.
qlBlackCalculatorItmCashProbability :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorItmCashProbability a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorItmCashProbability'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1855 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to discounting rate.
qlBlackCalculatorRho :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 -> IO ((Double))
qlBlackCalculatorRho a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorRho'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1859 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to strike.
qlBlackCalculatorStrikeSensitivity :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorStrikeSensitivity a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorStrikeSensitivity'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1862 "./QuantLib/PricingEngine.chs" #-}


-- |gamma w.r.t. strike.
qlBlackCalculatorStrikeGamma :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorStrikeGamma a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorStrikeGamma'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1865 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to time to maturity.
qlBlackCalculatorTheta :: (GenBlackCalculator bc) -> (Double) -- ^spot
 -> (Double) -- ^maturity
 -> IO ((Double))
qlBlackCalculatorTheta a1 a2 a3 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  qlBlackCalculatorTheta'_ a1' a2' a3' a4' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a4'>>
  return (res')

{-# LINE 1870 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to time to maturity per day, assuming 365 day per year.
qlBlackCalculatorThetaPerDay :: (GenBlackCalculator bc) -> (Double) -- ^spot
 -> (Double) -- ^maturity
 -> IO ((Double))
qlBlackCalculatorThetaPerDay a1 a2 a3 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  qlBlackCalculatorThetaPerDay'_ a1' a2' a3' a4' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a4'>>
  return (res')

{-# LINE 1875 "./QuantLib/PricingEngine.chs" #-}


-- |the option's fair value
qlBlackCalculatorValue :: (GenBlackCalculator bc) -> IO ((Double))
qlBlackCalculatorValue a1 =
  withBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBlackCalculatorValue'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1878 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity of vega to spot (Vanna).
blackVanna :: (GenBlackCalculator bc) -> (Double) -- ^spot
 -> (Double) -- ^maturity
 -> IO ((Double))
blackVanna a1 a2 a3 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  blackVanna'_ a1' a2' a3' a4' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a4'>>
  return (res')

{-# LINE 1883 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to volatility.
qlBlackCalculatorVega :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 -> IO ((Double))
qlBlackCalculatorVega a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorVega'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1887 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity of vega to volatility (Volga).
qlBlackCalculatorVolga :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 -> IO ((Double))
qlBlackCalculatorVolga a1 a2 =
  withBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBlackCalculatorVolga'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1891 "./QuantLib/PricingEngine.chs" #-}


-- |Black-Scholes-Merton option-price calculator, from the option type and strike directly
blackScholesCalculatorAtStrikeRaw :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^spot
 -> (Double) -- ^growth
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((BlackScholesCalculator))
blackScholesCalculatorAtStrikeRaw a1 a2 a3 a4 a5 a6 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  blackScholesCalculatorAtStrikeRaw'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekBlackScholesCalculator res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 1899 "./QuantLib/PricingEngine.chs" #-}


-- |Black-Scholes-Merton option-price calculator, from a striked payoff and spot price
blackScholesCalculatorFromPayoffRaw :: (StrikedPayoff) -> (Double) -- ^spot
 -> (Double) -- ^growth
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((BlackScholesCalculator))
blackScholesCalculatorFromPayoffRaw a1 a2 a3 a4 a5 =
  withStrikedPayoff a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  blackScholesCalculatorFromPayoffRaw'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  peekBlackScholesCalculator res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 1906 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to change in the underlying spot price.
blackScholesDelta :: (BlackScholesCalculator) -> IO ((Double))
blackScholesDelta a1 =
  withGenBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  blackScholesDelta'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1909 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity in percent to a percent change in the underlying spot price.
blackScholesElasticity :: (BlackScholesCalculator) -> IO ((Double))
blackScholesElasticity a1 =
  withGenBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  blackScholesElasticity'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1912 "./QuantLib/PricingEngine.chs" #-}


-- |Second order derivative with respect to change in the underlying spot price.
blackScholesGamma :: (BlackScholesCalculator) -> IO ((Double))
blackScholesGamma a1 =
  withGenBlackCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  blackScholesGamma'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1915 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to time to maturity.
blackScholesTheta :: (BlackScholesCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
blackScholesTheta a1 a2 =
  withGenBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  blackScholesTheta'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1919 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to time to maturity per day (assuming 365 day in a year).
blackScholesThetaPerDay :: (BlackScholesCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
blackScholesThetaPerDay a1 a2 =
  withGenBlackCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  blackScholesThetaPerDay'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1923 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier (normal-model) analogue of 'BlackCalculator', for options on a rate rather than a
-- price. No subclass hierarchy upstream, unlike BlackCalculator\/BlackScholesCalculator, so this
-- is a single leaf type with its own methods rather than a t'GenBlackCalculator' instance.
bachelierCalculatorAtStrikeRaw :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((BachelierCalculator))
bachelierCalculatorAtStrikeRaw :: OptionType
-> Double -> Double -> Double -> Double -> IO BachelierCalculator
bachelierCalculatorAtStrikeRaw OptionType
a1 Double
a2 Double
a3 Double
a4 Double
a5 =
  let {a1' :: CInt
a1' = OptionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC OptionType
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  (Ptr (Ptr CChar) -> IO BachelierCalculator)
-> IO BachelierCalculator
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO BachelierCalculator)
 -> IO BachelierCalculator)
-> (Ptr (Ptr CChar) -> IO BachelierCalculator)
-> IO BachelierCalculator
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a6' -> 
  CInt
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CBachelierCalculator)
bachelierCalculatorAtStrikeRaw'_ CInt
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' Ptr (Ptr CChar)
a6' IO (Ptr CBachelierCalculator)
-> (Ptr CBachelierCalculator -> IO BachelierCalculator)
-> IO BachelierCalculator
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CBachelierCalculator
res ->
  Ptr CBachelierCalculator -> IO BachelierCalculator
peekBachelierCalculator Ptr CBachelierCalculator
res IO BachelierCalculator
-> (BachelierCalculator -> IO BachelierCalculator)
-> IO BachelierCalculator
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \BachelierCalculator
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a6'IO () -> IO BachelierCalculator -> IO BachelierCalculator
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  BachelierCalculator -> IO BachelierCalculator
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (BachelierCalculator
res')

{-# LINE 1932 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier (normal-model) option-price calculator, from a striked payoff
bachelierCalculatorFromPayoffRaw :: (StrikedPayoff) -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((BachelierCalculator))
bachelierCalculatorFromPayoffRaw a1 a2 a3 a4 =
  withStrikedPayoff a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  bachelierCalculatorFromPayoffRaw'_ a1' a2' a3' a4' a5' >>= \res ->
  peekBachelierCalculator res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 1939 "./QuantLib/PricingEngine.chs" #-}


-- |intermediate value used internally to derive the calculator's Greeks
qlBachelierCalculatorAlpha :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorAlpha a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorAlpha'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1942 "./QuantLib/PricingEngine.chs" #-}


-- |intermediate value used internally to derive the calculator's Greeks
qlBachelierCalculatorBeta :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorBeta a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorBeta'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1945 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to change in the underlying spot price.
qlBachelierCalculatorDelta :: (BachelierCalculator) -> (Double) -- ^spot
 -> IO ((Double))
qlBachelierCalculatorDelta a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorDelta'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1949 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to change in the underlying forward price.
qlBachelierCalculatorDeltaForward :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorDeltaForward a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorDeltaForward'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1952 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to dividend/growth rate.
qlBachelierCalculatorDividendRho :: (BachelierCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
qlBachelierCalculatorDividendRho a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorDividendRho'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1956 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity in percent to a percent change in the underlying spot price.
qlBachelierCalculatorElasticity :: (BachelierCalculator) -> (Double) -- ^spot
 -> IO ((Double))
qlBachelierCalculatorElasticity a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorElasticity'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1960 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity in percent to a percent change in the underlying forward price.
qlBachelierCalculatorElasticityForward :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorElasticityForward a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorElasticityForward'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1963 "./QuantLib/PricingEngine.chs" #-}


-- |Second order derivative with respect to change in the underlying spot price.
qlBachelierCalculatorGamma :: (BachelierCalculator) -> (Double) -- ^spot
 -> IO ((Double))
qlBachelierCalculatorGamma a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorGamma'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1967 "./QuantLib/PricingEngine.chs" #-}


-- |Second order derivative with respect to change in the underlying forward price.
qlBachelierCalculatorGammaForward :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorGammaForward a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorGammaForward'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1970 "./QuantLib/PricingEngine.chs" #-}


-- |Probability of being in the money in the asset martingale measure, i.e. N(d). It is a risk-neutral probability, not the real world one.
qlBachelierCalculatorItmAssetProbability :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorItmAssetProbability a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorItmAssetProbability'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1973 "./QuantLib/PricingEngine.chs" #-}


-- |Probability of being in the money in the bond martingale measure, i.e. N(d). It is a risk-neutral probability, not the real world one.
qlBachelierCalculatorItmCashProbability :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorItmCashProbability a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorItmCashProbability'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1976 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to discounting rate.
qlBachelierCalculatorRho :: (BachelierCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
qlBachelierCalculatorRho a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorRho'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 1980 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to strike.
qlBachelierCalculatorStrikeSensitivity :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorStrikeSensitivity a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorStrikeSensitivity'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1983 "./QuantLib/PricingEngine.chs" #-}


-- |gamma w.r.t. strike.
qlBachelierCalculatorStrikeGamma :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorStrikeGamma a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorStrikeGamma'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1986 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to time to maturity.
qlBachelierCalculatorTheta :: (BachelierCalculator) -> (Double) -- ^spot
 -> (Double) -- ^maturity
 -> IO ((Double))
qlBachelierCalculatorTheta a1 a2 a3 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  qlBachelierCalculatorTheta'_ a1' a2' a3' a4' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a4'>>
  return (res')

{-# LINE 1991 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to time to maturity per day, assuming 365 day per year.
qlBachelierCalculatorThetaPerDay :: (BachelierCalculator) -> (Double) -- ^spot
 -> (Double) -- ^maturity
 -> IO ((Double))
qlBachelierCalculatorThetaPerDay a1 a2 a3 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  preErrorCheck $ \a4' -> 
  qlBachelierCalculatorThetaPerDay'_ a1' a2' a3' a4' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a4'>>
  return (res')

{-# LINE 1996 "./QuantLib/PricingEngine.chs" #-}


-- |the option's fair value
qlBachelierCalculatorValue :: (BachelierCalculator) -> IO ((Double))
qlBachelierCalculatorValue a1 =
  withBachelierCalculator a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  qlBachelierCalculatorValue'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 1999 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity of vega to spot (Vanna).
bachelierVanna :: (BachelierCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
bachelierVanna a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  bachelierVanna'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 2003 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity to volatility.
qlBachelierCalculatorVega :: (BachelierCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
qlBachelierCalculatorVega a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorVega'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 2007 "./QuantLib/PricingEngine.chs" #-}


-- |Sensitivity of vega to volatility (Volga).
qlBachelierCalculatorVolga :: (BachelierCalculator) -> (Double) -- ^maturity
 -> IO ((Double))
qlBachelierCalculatorVolga a1 a2 =
  withBachelierCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  qlBachelierCalculatorVolga'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 2011 "./QuantLib/PricingEngine.chs" #-}


-- |The common Black and Bachelier option-calculator surface. Operations whose inputs differ
-- between the models, such as vanna, remain model-qualified functions.
class HasOptionCalculator a where
  alpha :: a -> IO Double
  beta :: a -> IO Double
  delta :: a -> Double -> IO Double
  deltaForward :: a -> IO Double
  dividendRho :: a -> Double -> IO Double
  elasticity :: a -> Double -> IO Double
  elasticityForward :: a -> IO Double
  gamma :: a -> Double -> IO Double
  gammaForward :: a -> IO Double
  itmAssetProbability :: a -> IO Double
  itmCashProbability :: a -> IO Double
  rho :: a -> Double -> IO Double
  strikeSensitivity :: a -> IO Double
  strikeGamma :: a -> IO Double
  theta :: a -> Double -> Double -> IO Double
  thetaPerDay :: a -> Double -> Double -> IO Double
  value :: a -> IO Double
  vega :: a -> Double -> IO Double
  volga :: a -> Double -> IO Double

instance HasOptionCalculator (GenBlackCalculator bc) where
  alpha :: GenBlackCalculator bc -> IO Double
alpha = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorAlpha
  beta :: GenBlackCalculator bc -> IO Double
beta = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorBeta
  delta :: GenBlackCalculator bc -> Double -> IO Double
delta = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorDelta
  deltaForward :: GenBlackCalculator bc -> IO Double
deltaForward = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorDeltaForward
  dividendRho :: GenBlackCalculator bc -> Double -> IO Double
dividendRho = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorDividendRho
  elasticity :: GenBlackCalculator bc -> Double -> IO Double
elasticity = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorElasticity
  elasticityForward :: GenBlackCalculator bc -> IO Double
elasticityForward = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorElasticityForward
  gamma :: GenBlackCalculator bc -> Double -> IO Double
gamma = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorGamma
  gammaForward :: GenBlackCalculator bc -> IO Double
gammaForward = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorGammaForward
  itmAssetProbability :: GenBlackCalculator bc -> IO Double
itmAssetProbability = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorItmAssetProbability
  itmCashProbability :: GenBlackCalculator bc -> IO Double
itmCashProbability = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorItmCashProbability
  rho :: GenBlackCalculator bc -> Double -> IO Double
rho = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorRho
  strikeSensitivity :: GenBlackCalculator bc -> IO Double
strikeSensitivity = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorStrikeSensitivity
  strikeGamma :: GenBlackCalculator bc -> IO Double
strikeGamma = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorStrikeGamma
  theta :: GenBlackCalculator bc -> Double -> Double -> IO Double
theta = GenBlackCalculator bc -> Double -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> Double -> IO Double
qlBlackCalculatorTheta
  thetaPerDay :: GenBlackCalculator bc -> Double -> Double -> IO Double
thetaPerDay = GenBlackCalculator bc -> Double -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> Double -> IO Double
qlBlackCalculatorThetaPerDay
  value :: GenBlackCalculator bc -> IO Double
value = GenBlackCalculator bc -> IO Double
forall bc. GenBlackCalculator bc -> IO Double
qlBlackCalculatorValue
  vega :: GenBlackCalculator bc -> Double -> IO Double
vega = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorVega
  volga :: GenBlackCalculator bc -> Double -> IO Double
volga = GenBlackCalculator bc -> Double -> IO Double
forall bc. GenBlackCalculator bc -> Double -> IO Double
qlBlackCalculatorVolga

instance HasOptionCalculator BachelierCalculator where
  alpha :: BachelierCalculator -> IO Double
alpha = BachelierCalculator -> IO Double
qlBachelierCalculatorAlpha
  beta :: BachelierCalculator -> IO Double
beta = BachelierCalculator -> IO Double
qlBachelierCalculatorBeta
  delta :: BachelierCalculator -> Double -> IO Double
delta = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorDelta
  deltaForward :: BachelierCalculator -> IO Double
deltaForward = BachelierCalculator -> IO Double
qlBachelierCalculatorDeltaForward
  dividendRho :: BachelierCalculator -> Double -> IO Double
dividendRho = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorDividendRho
  elasticity :: BachelierCalculator -> Double -> IO Double
elasticity = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorElasticity
  elasticityForward :: BachelierCalculator -> IO Double
elasticityForward = BachelierCalculator -> IO Double
qlBachelierCalculatorElasticityForward
  gamma :: BachelierCalculator -> Double -> IO Double
gamma = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorGamma
  gammaForward :: BachelierCalculator -> IO Double
gammaForward = BachelierCalculator -> IO Double
qlBachelierCalculatorGammaForward
  itmAssetProbability :: BachelierCalculator -> IO Double
itmAssetProbability = BachelierCalculator -> IO Double
qlBachelierCalculatorItmAssetProbability
  itmCashProbability :: BachelierCalculator -> IO Double
itmCashProbability = BachelierCalculator -> IO Double
qlBachelierCalculatorItmCashProbability
  rho :: BachelierCalculator -> Double -> IO Double
rho = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorRho
  strikeSensitivity :: BachelierCalculator -> IO Double
strikeSensitivity = BachelierCalculator -> IO Double
qlBachelierCalculatorStrikeSensitivity
  strikeGamma :: BachelierCalculator -> IO Double
strikeGamma = BachelierCalculator -> IO Double
qlBachelierCalculatorStrikeGamma
  theta :: BachelierCalculator -> Double -> Double -> IO Double
theta = BachelierCalculator -> Double -> Double -> IO Double
qlBachelierCalculatorTheta
  thetaPerDay :: BachelierCalculator -> Double -> Double -> IO Double
thetaPerDay = BachelierCalculator -> Double -> Double -> IO Double
qlBachelierCalculatorThetaPerDay
  value :: BachelierCalculator -> IO Double
value = BachelierCalculator -> IO Double
qlBachelierCalculatorValue
  vega :: BachelierCalculator -> Double -> IO Double
vega = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorVega
  volga :: BachelierCalculator -> Double -> IO Double
volga = BachelierCalculator -> Double -> IO Double
qlBachelierCalculatorVolga

-- |computes the strike given the option's Black-Scholes delta (in an FX-style delta/vol quotation)
blackDeltaCalculator :: (OptionType) -> (DeltaType) -> (Double) -- ^spot
 -> (Double) -- ^dDiscount (domestic discount factor)
 -> (Double) -- ^fDiscount (foreign discount factor)
 -> (Double) -- ^stdDev
 -> IO ((BlackDeltaCalculator))
blackDeltaCalculator :: OptionType
-> DeltaType
-> Double
-> Double
-> Double
-> Double
-> IO BlackDeltaCalculator
blackDeltaCalculator OptionType
a1 DeltaType
a2 Double
a3 Double
a4 Double
a5 Double
a6 =
  let {a1' :: CInt
a1' = OptionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC OptionType
a1} in 
  let {a2' :: CInt
a2' = DeltaType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC DeltaType
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  (Ptr (Ptr CChar) -> IO BlackDeltaCalculator)
-> IO BlackDeltaCalculator
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO BlackDeltaCalculator)
 -> IO BlackDeltaCalculator)
-> (Ptr (Ptr CChar) -> IO BlackDeltaCalculator)
-> IO BlackDeltaCalculator
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a7' -> 
  CInt
-> CInt
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CBlackDeltaCalculator)
blackDeltaCalculator'_ CInt
a1' CInt
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' Ptr (Ptr CChar)
a7' IO (Ptr CBlackDeltaCalculator)
-> (Ptr CBlackDeltaCalculator -> IO BlackDeltaCalculator)
-> IO BlackDeltaCalculator
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CBlackDeltaCalculator
res ->
  Ptr CBlackDeltaCalculator -> IO BlackDeltaCalculator
peekBlackDeltaCalculator Ptr CBlackDeltaCalculator
res IO BlackDeltaCalculator
-> (BlackDeltaCalculator -> IO BlackDeltaCalculator)
-> IO BlackDeltaCalculator
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \BlackDeltaCalculator
res' ->
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a7'IO () -> IO BlackDeltaCalculator -> IO BlackDeltaCalculator
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  BlackDeltaCalculator -> IO BlackDeltaCalculator
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (BlackDeltaCalculator
res')

{-# LINE 2085 "./QuantLib/PricingEngine.chs" #-}


-- |the option delta under the calculator's chosen convention, for the given strike
deltaFromStrike :: (BlackDeltaCalculator) -> (Double) -- ^strike
 -> IO ((Double))
deltaFromStrike a1 a2 =
  withBlackDeltaCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  deltaFromStrike'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 2089 "./QuantLib/PricingEngine.chs" #-}


-- |the strike price corresponding to the given option delta (under the calculator's chosen convention)
strikeFromDelta :: (BlackDeltaCalculator) -> (Double) -- ^delta
 -> IO ((Double))
strikeFromDelta a1 a2 =
  withBlackDeltaCalculator a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  preErrorCheck $ \a3' -> 
  strikeFromDelta'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 2093 "./QuantLib/PricingEngine.chs" #-}


-- |the at-the-money strike under the given ATM convention, independent of the strike passed at construction
atmStrike :: (BlackDeltaCalculator) -> (AtmType) -> IO ((Double))
atmStrike a1 a2 =
  withBlackDeltaCalculator a1 $ \a1' -> 
  let {a2' = fromEnumC a2} in 
  preErrorCheck $ \a3' -> 
  atmStrike'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 2097 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 formula /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)
blackFormula :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackFormula :: OptionType
-> Double -> Double -> Double -> Double -> Double -> IO Double
blackFormula OptionType
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 =
  let {a1' :: CInt
a1' = OptionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC OptionType
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a7' -> 
  CInt
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO CDouble
blackFormula'_ CInt
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' Ptr (Ptr CChar)
a7' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2105 "./QuantLib/PricingEngine.chs" #-}



-- |Black 1976 probability of being in the money (in the bond martingale measure), i.e. N(d2). It is a risk-neutral probability, not the real world one. /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)
blackCashItmProbability :: (OptionType) -> (Double) -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^displacement
 -> IO ((Double))
blackCashItmProbability a1 a2 a3 a4 a5 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  blackCashItmProbability'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 2113 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 implied standard deviation, i.e. volatility*sqrt(timeToMaturity)
blackImpliedStdDev :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^blackPrice
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> (Double) -- ^guess
 -> (Double) -- ^accuracy
 -> (Word) -- ^maxIterations
 -> IO ((Double))
blackImpliedStdDev :: OptionType
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Word
-> IO Double
blackImpliedStdDev OptionType
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 Double
a7 Double
a8 Word
a9 =
  let {a1' :: CInt
a1' = OptionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC OptionType
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in 
  let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in 
  let {a9' :: CUInt
a9' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a9} in 
  (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' -> 
  CInt
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CUInt
-> Ptr (Ptr CChar)
-> IO CDouble
blackImpliedStdDev'_ CInt
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' CDouble
a7' CDouble
a8' CUInt
a9' Ptr (Ptr CChar)
a10' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a10'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 2124 "./QuantLib/PricingEngine.chs" #-}


-- |Approximated Black 1976 implied standard deviation, i.e. volatility*sqrt(timeToMaturity).It is calculated using Brenner and Subrahmanyan (1988) and Feinstein (1988) approximation for at-the-money forward option, with the extended moneyness approximation by Corrado and Miller (1996)
blackImpliedStdDevApproximation :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^blackPrice
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackImpliedStdDevApproximation a1 a2 a3 a4 a5 a6 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  blackImpliedStdDevApproximation'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2132 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 formula for standard deviation derivative /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity), and it returns the derivative with respect to the standard deviation. If T is the time to maturity Black vega would be blackStdDevDerivative(strike, forward, stdDev)*sqrt(T)
blackStdDevDerivative :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackStdDevDerivative a1 a2 a3 a4 a5 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  blackStdDevDerivative'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 2140 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 formula for derivative with respect to implied vol, this is basically the vega, but if you want 1% change multiply by 1%
blackVolDerivative :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^expiry
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackVolDerivative a1 a2 a3 a4 a5 a6 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  blackVolDerivative'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2149 "./QuantLib/PricingEngine.chs" #-}


-- |Black style formula when forward is normal rather than log-normal. This is essentially the model of Bachelier. /Warning/ Bachelier model needs absolute volatility, not percentage volatility. Standard deviation is absoluteVolatility*sqrt(timeToMaturity)
bachelierBlackFormula :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((Double))
bachelierBlackFormula a1 a2 a3 a4 a5 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  bachelierBlackFormula'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 2156 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 formula for the derivative with respect to the forward. /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)
blackForwardDerivative :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackForwardDerivative a1 a2 a3 a4 a5 a6 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  blackForwardDerivative'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2164 "./QuantLib/PricingEngine.chs" #-}


-- |Approximated Black 1976 implied standard deviation following Chambers and Nawalkha, /The Financial Review/ 2001, 89-100. The at-the-money option price must be known to use this method.
blackImpliedStdDevChambers :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^blackPrice
 -> (Double) -- ^blackAtmPrice
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackImpliedStdDevChambers a1 a2 a3 a4 a5 a6 a7 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  preErrorCheck $ \a8' -> 
  blackImpliedStdDevChambers'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a8'>>
  return (res')

{-# LINE 2173 "./QuantLib/PricingEngine.chs" #-}


-- |Approximated Black 1976 implied standard deviation following Radoicic and Stefanica, /An Explicit Implicit Volatility Formula/
blackImpliedStdDevApproximationRs :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^blackPrice
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackImpliedStdDevApproximationRs a1 a2 a3 a4 a5 a6 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  blackImpliedStdDevApproximationRs'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2181 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 implied standard deviation by the Li-Rational-Substitution solver, started from the Radoicic-Stefanica approximation. Pass 'Nothing' for the guess to let QuantLib pick the starting point.
blackImpliedStdDevLiRs :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^blackPrice
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> (Maybe Double) -- ^guess
 -> (Double) -- ^omega
 -> (Double) -- ^accuracy
 -> (Word) -- ^maxIterations
 -> IO ((Double))
blackImpliedStdDevLiRs a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = fromMaybeDouble a7} in 
  let {a8' = realToFrac a8} in 
  let {a9' = realToFrac a9} in 
  let {a10' = fromIntegral a10} in 
  preErrorCheck $ \a11' -> 
  blackImpliedStdDevLiRs'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a11'>>
  return (res')

{-# LINE 2193 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 probability of being in the money in the asset martingale measure, i.e. N(d1). It is a risk-neutral probability, not the real world one.
blackAssetItmProbability :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^displacement
 -> IO ((Double))
blackAssetItmProbability a1 a2 a3 a4 a5 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  blackAssetItmProbability'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 2200 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 formula for the second derivative with respect to the standard deviation. /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)
blackStdDevSecondDerivative :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> (Double) -- ^displacement
 -> IO ((Double))
blackStdDevSecondDerivative a1 a2 a3 a4 a5 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  blackStdDevSecondDerivative'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 2208 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier formula for the derivative with respect to the forward. /Warning/ the Bachelier model needs absolute volatility, not percentage volatility; standard deviation is absoluteVolatility*sqrt(timeToMaturity)
bachelierForwardDerivative :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((Double))
bachelierForwardDerivative a1 a2 a3 a4 a5 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  preErrorCheck $ \a6' -> 
  bachelierForwardDerivative'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 2215 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier implied (absolute) volatility by the analytic formula of Jaeckel (2017), /Implied Normal Volatility/. Unlike the Black implied-standard-deviation functions this takes the time to expiry and returns a volatility, not a standard deviation.
bachelierImpliedVol :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^tte
 -> (Double) -- ^bachelierPrice
 -> (Double) -- ^discount
 -> IO ((Double))
bachelierImpliedVol a1 a2 a3 a4 a5 a6 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  bachelierImpliedVol'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2223 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier implied (absolute) volatility by the analytic approximation of Choi, Kim and Kwak (2009). Unlike the Black implied-standard-deviation functions this takes the time to expiry and returns a volatility, not a standard deviation.
bachelierImpliedVolChoi :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^tte
 -> (Double) -- ^bachelierPrice
 -> (Double) -- ^discount
 -> IO ((Double))
bachelierImpliedVolChoi a1 a2 a3 a4 a5 a6 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  preErrorCheck $ \a7' -> 
  bachelierImpliedVolChoi'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a7'>>
  return (res')

{-# LINE 2231 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier formula for the standard deviation derivative. /Warning/ it returns the derivative with respect to the standard deviation; Bachelier vega is this times sqrt(T).
bachelierStdDevDerivative :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> (Double) -- ^discount
 -> IO ((Double))
bachelierStdDevDerivative a1 a2 a3 a4 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  bachelierStdDevDerivative'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a5'>>
  return (res')

{-# LINE 2238 "./QuantLib/PricingEngine.chs" #-}


-- |Bachelier probability of being in the money in the asset martingale measure, i.e. N(d). It is a risk-neutral probability, not the real world one.
bachelierAssetItmProbability :: (OptionType) -> (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^stdDev
 -> IO ((Double))
bachelierAssetItmProbability a1 a2 a3 a4 =
  let {a1' = fromEnumC a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  bachelierAssetItmProbability'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a5'>>
  return (res')

{-# LINE 2244 "./QuantLib/PricingEngine.chs" #-}


-- |default theta-per-day calculation
defaultThetaPerDay :: (Double) -- ^theta
 -> IO ((Double))
defaultThetaPerDay a1 =
  let {a1' = realToFrac a1} in 
  preErrorCheck $ \a2' -> 
  defaultThetaPerDay'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 2248 "./QuantLib/PricingEngine.chs" #-}


-- |lognormal SABR volatility, no validity checks on the parameters
unsafeSabrLogNormalVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> IO ((Double))
unsafeSabrLogNormalVolatility :: Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> IO Double
unsafeSabrLogNormalVolatility Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 Double
a7 =
  let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in 
  (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a8' -> 
  CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO CDouble
unsafeSabrLogNormalVolatility'_ CDouble
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' CDouble
a7' Ptr (Ptr CChar)
a8' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a8'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 2258 "./QuantLib/PricingEngine.chs" #-}


-- |shifted SABR volatility (lognormal or normal), no validity checks on the parameters
unsafeShiftedSabrVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> (Double) -- ^shift
 -> (VolatilityType) -- ^volatilityType
 -> IO ((Double))
unsafeShiftedSabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  let {a8' = realToFrac a8} in 
  let {a9' = (fromIntegral . fromEnum) a9} in 
  preErrorCheck $ \a10' -> 
  unsafeShiftedSabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a10'>>
  return (res')

{-# LINE 2270 "./QuantLib/PricingEngine.chs" #-}


-- |normal SABR volatility, no validity checks on the parameters
unsafeSabrNormalVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> IO ((Double))
unsafeSabrNormalVolatility a1 a2 a3 a4 a5 a6 a7 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  preErrorCheck $ \a8' -> 
  unsafeSabrNormalVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a8'>>
  return (res')

{-# LINE 2280 "./QuantLib/PricingEngine.chs" #-}


-- |SABR volatility (lognormal or normal), no validity checks on the parameters
unsafeSabrVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> (VolatilityType) -- ^volatilityType
 -> IO ((Double))
unsafeSabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  let {a8' = (fromIntegral . fromEnum) a8} in 
  preErrorCheck $ \a9' -> 
  unsafeSabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a9'>>
  return (res')

{-# LINE 2291 "./QuantLib/PricingEngine.chs" #-}


-- |SABR volatility (lognormal or normal), with validity checks on the parameters
sabrVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> (VolatilityType) -- ^volatilityType
 -> IO ((Double))
sabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  let {a8' = (fromIntegral . fromEnum) a8} in 
  preErrorCheck $ \a9' -> 
  sabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a9'>>
  return (res')

{-# LINE 2302 "./QuantLib/PricingEngine.chs" #-}


-- |shifted SABR volatility (lognormal or normal), with validity checks on the parameters
shiftedSabrVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> (Double) -- ^shift
 -> (VolatilityType) -- ^volatilityType
 -> IO ((Double))
shiftedSabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  let {a8' = realToFrac a8} in 
  let {a9' = (fromIntegral . fromEnum) a9} in 
  preErrorCheck $ \a10' -> 
  shiftedSabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a10'>>
  return (res')

{-# LINE 2314 "./QuantLib/PricingEngine.chs" #-}


-- |lognormal SABR volatility using the Floc'h-Kennedy formula, with validity checks on the parameters
sabrFlochKennedyVolatility :: (Double) -- ^strike
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> IO ((Double))
sabrFlochKennedyVolatility a1 a2 a3 a4 a5 a6 a7 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = realToFrac a5} in 
  let {a6' = realToFrac a6} in 
  let {a7' = realToFrac a7} in 
  preErrorCheck $ \a8' -> 
  sabrFlochKennedyVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a8'>>
  return (res')

{-# LINE 2324 "./QuantLib/PricingEngine.chs" #-}


-- |validate SABR parameters, throwing if they are not acceptable
validateSabrParameters :: (Double) -- ^alpha
 -> (Double) -- ^beta
 -> (Double) -- ^nu
 -> (Double) -- ^rho
 -> IO ()
validateSabrParameters a1 a2 a3 a4 =
  let {a1' = realToFrac a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  preErrorCheck $ \a5' -> 
  validateSabrParameters'_ a1' a2' a3' a4' a5' >>
  errorCheck  a5'>>
  return ()

{-# LINE 2331 "./QuantLib/PricingEngine.chs" #-}


-- |initial guess (alpha, beta, nu, rho) for SABR calibration, per Le Floc'h and Kennedy
sabrGuess :: (Double) -- ^k_m
 -> (Double) -- ^vol_m
 -> (Double) -- ^k_0
 -> (Double) -- ^vol_0
 -> (Double) -- ^k_p
 -> (Double) -- ^vol_p
 -> (Double) -- ^forward
 -> (Double) -- ^expiryTime
 -> (Double) -- ^beta
 -> (Double) -- ^shift
 -> (VolatilityType) -- ^volatilityType
 -> IO (([Double]))
sabrGuess :: Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> VolatilityType
-> IO [Double]
sabrGuess Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 Double
a7 Double
a8 Double
a9 Double
a10 VolatilityType
a11 =
  let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in 
  let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in 
  let {a9' :: CDouble
a9' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a9} in 
  let {a10' :: CDouble
a10' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a10} in 
  let {a11' :: CInt
a11' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (VolatilityType -> Int) -> VolatilityType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VolatilityType -> Int
forall a. Enum a => a -> Int
fromEnum) VolatilityType
a11} in 
  ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO [Double]) -> IO [Double]
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO [Double]) -> IO [Double])
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a12'1, Ptr (Ptr CDouble)
a12'2) -> 
  (Ptr (Ptr CChar) -> IO [Double]) -> IO [Double]
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO [Double]) -> IO [Double])
-> (Ptr (Ptr CChar) -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a13' -> 
  CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CInt
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr CChar)
-> IO ()
sabrGuess'_ CDouble
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' CDouble
a7' CDouble
a8' CDouble
a9' CDouble
a10' CInt
a11' Ptr CUInt
a12'1  Ptr (Ptr CDouble)
a12'2 Ptr (Ptr CChar)
a13' IO () -> IO [Double] -> IO [Double]
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray  Ptr CUInt
a12'1  Ptr (Ptr CDouble)
a12'2IO [Double] -> ([Double] -> IO [Double]) -> IO [Double]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Double]
a12'' -> 
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a13'IO () -> IO [Double] -> IO [Double]
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  [Double] -> IO [Double]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Double]
a12'')

{-# LINE 2346 "./QuantLib/PricingEngine.chs" #-}


-- |Black 1976 option-price calculator.
blackCalculator :: StrikeSpec -> Double -> Double -> Double -> IO BlackCalculator
blackCalculator spec = case spec of
  Strike t k -> blackCalculatorAtStrikeRaw t k
  StrikePayoff p -> blackCalculatorFromPayoffRaw p

-- |Black-Scholes-Merton option-price calculator.
blackScholesCalculator :: StrikeSpec -> Double -> Double -> Double -> Double
  -> IO BlackScholesCalculator
blackScholesCalculator spec = case spec of
  Strike t k -> blackScholesCalculatorAtStrikeRaw t k
  StrikePayoff p -> blackScholesCalculatorFromPayoffRaw p

-- |Bachelier (normal-model) option-price calculator.
bachelierCalculator :: StrikeSpec -> Double -> Double -> Double -> IO BachelierCalculator
bachelierCalculator spec = case spec of
  Strike t k -> bachelierCalculatorAtStrikeRaw t k
  StrikePayoff p -> bachelierCalculatorFromPayoffRaw p

-- vim: set ff=unix ts=8 sts=2 sw=2 et:

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingBondEngine"
  discountingBondEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingPerpetualFuturesEngine"
  qlDiscountingPerpetualFuturesEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlRiskyBondEngine"
  riskyBondEngine'_ :: ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingSwapEngine"
  discountingSwapEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingFxForwardEngine"
  discountingFxForwardEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingConstNotionalCrossCurrencySwapEngine"
  discountingConstNotionalCrossCurrencySwapEngine'_ :: ((C2HSImp.Ptr (CCurrency)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CCurrency)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlCounterpartyAdjSwapEngine"
  counterpartyAdjSwapEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticBarrierEngine"
  analyticBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticTwoAssetBarrierEngine"
  analyticTwoAssetBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticSoftBarrierEngine"
  analyticSoftBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticSimpleChooserEngine"
  analyticSimpleChooserEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticComplexChooserEngine"
  analyticComplexChooserEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticTwoAssetCorrelationEngine"
  analyticTwoAssetCorrelationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticEuropeanMargrabeEngine"
  analyticEuropeanMargrabeEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticAmericanMargrabeEngine"
  analyticAmericanMargrabeEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticWriterExtensibleOptionEngine"
  analyticWriterExtensibleOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHolderExtensibleOptionEngine"
  analyticHolderExtensibleOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticPartialTimeBarrierOptionEngine"
  analyticPartialTimeBarrierOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticBinaryBarrierEngine"
  analyticBinaryBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialBarrierEngine"
  binomialBarrierEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlVannaVolgaBarrierEngine"
  vannaVolgaBarrierEngine'_ :: ((C2HSImp.Ptr (CDeltaVolQuote')) -> ((C2HSImp.Ptr (CDeltaVolQuote')) -> ((C2HSImp.Ptr (CDeltaVolQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDoubleBarrierEngine"
  analyticDoubleBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlVannaVolgaDoubleBarrierEngine"
  vannaVolgaDoubleBarrierEngine'_ :: ((C2HSImp.Ptr (CDeltaVolQuote')) -> ((C2HSImp.Ptr (CDeltaVolQuote')) -> ((C2HSImp.Ptr (CDeltaVolQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialDoubleBarrierEngine"
  binomialDoubleBarrierEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDoubleBarrierEngine"
  mcDoubleBarrierEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticCliquetEngine"
  analyticCliquetEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticCompoundOptionEngine"
  analyticCompoundOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousFixedLookbackEngine"
  analyticContinuousFixedLookbackEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousFloatingLookbackEngine"
  analyticContinuousFloatingLookbackEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousPartialFloatingLookbackEngine"
  analyticContinuousPartialFloatingLookbackEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousPartialFixedLookbackEngine"
  analyticContinuousPartialFixedLookbackEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousGeometricAveragePriceAsianEngine"
  analyticContinuousGeometricAveragePriceAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousGeometricAveragePriceAsianHestonEngine"
  analyticContinuousGeometricAveragePriceAsianHestonEngine'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDiscreteGeometricAveragePriceAsianHestonEngine"
  analyticDiscreteGeometricAveragePriceAsianHestonEngine'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCLookbackFixedEngine"
  mcLookbackFixedEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCLookbackFloatingEngine"
  mcLookbackFloatingEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCLookbackPartialFixedEngine"
  mcLookbackPartialFixedEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCLookbackPartialFloatingEngine"
  mcLookbackPartialFloatingEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDigitalAmericanEngine"
  analyticDigitalAmericanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDigitalAmericanKOEngine"
  analyticDigitalAmericanKoEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDiscreteGeometricAveragePriceAsianEngine"
  analyticDiscreteGeometricAveragePriceAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDiscreteGeometricAverageStrikeAsianEngine"
  analyticDiscreteGeometricAverageStrikeAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTurnbullWakemanAsianEngine"
  turnbullWakemanAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDividendEuropeanEngine"
  analyticDividendEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticEuropeanEngine"
  analyticEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticPerformanceEngine"
  analyticPerformanceEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardEuropeanEngine"
  forwardEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardBaroneAdesiWhaleyEngine"
  forwardBaroneAdesiWhaleyEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardBjerksundStenslandEngine"
  forwardBjerksundStenslandEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardFdBlackScholesVanillaEngine"
  forwardFdBlackScholesVanillaEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCForwardEuropeanBSEngine1"
  mcForwardEuropeanBsEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCForwardEuropeanHestonEngine1"
  mcForwardEuropeanHestonEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonForwardEuropeanEngine"
  analyticHestonForwardEuropeanEngine'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoEuropeanEngine"
  quantoEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoForwardEuropeanEngine"
  quantoForwardEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoForwardPerformanceEuropeanEngine"
  quantoForwardPerformanceEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoBarrierEngine"
  quantoBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoDoubleBarrierEngine"
  quantoDoubleBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCapFloorEngine1"
  blackCapFloorEngineFromVolatilityStructure'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCapFloorEngine"
  blackCapFloorEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackSwaptionEngine"
  blackSwaptionEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlHaganIrregularSwaptionEngine"
  haganIrregularSwaptionEngine'_ :: ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackSwaptionEngine1"
  blackSwaptionEngineFromVolatilityStructure'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCapFloorEngine1"
  bachelierCapFloorEngineFromVolatilityStructure'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCapFloorEngine"
  bachelierCapFloorEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlYoYInflationBlackCapFloorEngine"
  yoyInflationBlackCapFloorEngine'_ :: ((C2HSImp.Ptr (CYoYInflationIndex')) -> ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlYoYInflationUnitDisplacedBlackCapFloorEngine"
  yoyInflationUnitDisplacedBlackCapFloorEngine'_ :: ((C2HSImp.Ptr (CYoYInflationIndex')) -> ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlYoYInflationBachelierCapFloorEngine"
  yoyInflationBachelierCapFloorEngine'_ :: ((C2HSImp.Ptr (CYoYInflationIndex')) -> ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlInterpolatingCPICapFloorEngine"
  interpolatingCpiCapFloorEngine'_ :: ((C2HSImp.Ptr (CCPICapFloorTermPriceSurface')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierSwaptionEngine"
  bachelierSwaptionEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierSwaptionEngine1"
  bachelierSwaptionEngineFromVolatilityStructure'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticBSMHullWhiteEngine"
  analyticBsmHullWhiteEngine'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CHullWhite')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticCapFloorEngine"
  analyticCapFloorEngine'_ :: ((C2HSImp.Ptr (CAffineModel')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dCapFloorEngine"
  gaussian1dCapFloorEngine'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticGJRGARCHEngine"
  analyticGjrGarchEngine'_ :: ((C2HSImp.Ptr (CGJRGARCHModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonEngine"
  analyticHestonEngineTolerance'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonHullWhiteEngine"
  analyticHestonHullWhiteEngineOrder'_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CHullWhite')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesEngine"
  batesEngineOrder'_ :: ((C2HSImp.Ptr (CBatesModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFFTVanillaEngine"
  fftVanillaEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlG2SwaptionEngine"
  g2SwaptionEngine'_ :: ((C2HSImp.Ptr (CG2')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlJumpDiffusionEngine"
  jumpDiffusionEngine'_ :: ((C2HSImp.Ptr (CMerton76Process')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCapFloorEngine"
  treeCapFloorEngineTimeSteps'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeSwaptionEngine"
  treeSwaptionEngineTimeSteps'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeVanillaSwapEngine"
  treeVanillaSwapEngineTimeSteps'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlVarianceGammaEngine"
  varianceGammaEngine'_ :: ((C2HSImp.Ptr (CVarianceGammaProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonEngine1"
  analyticHestonEngineOrder'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonEngineOptimalControlVariate"
  analyticHestonEngineOptimalControlVariate'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonHullWhiteEngine1"
  analyticHestonHullWhiteEngineTolerance'_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CHullWhite')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesEngine1"
  batesEngineTolerance'_ :: ((C2HSImp.Ptr (CBatesModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBaroneAdesiWhaleyApproximationEngine"
  baroneAdesiWhaleyApproximationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDetJumpEngine1"
  batesDetJumpEngineTolerance'_ :: ((C2HSImp.Ptr (CBatesDetJumpModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDetJumpEngine"
  batesDetJumpEngineOrder'_ :: ((C2HSImp.Ptr (CBatesDetJumpModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpDetJumpEngine1"
  batesDoubleExpDetJumpEngineTolerance'_ :: ((C2HSImp.Ptr (CBatesDoubleExpDetJumpModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpDetJumpEngine"
  batesDoubleExpDetJumpEngineOrder'_ :: ((C2HSImp.Ptr (CBatesDoubleExpDetJumpModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpEngine1"
  batesDoubleExpEngineTolerance'_ :: ((C2HSImp.Ptr (CBatesDoubleExpModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpEngine"
  batesDoubleExpEngineOrder'_ :: ((C2HSImp.Ptr (CBatesDoubleExpModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBjerksundStenslandApproximationEngine"
  bjerksundStenslandApproximationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQdPlusAmericanEngine"
  qdPlusAmericanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQdFpAmericanEngine"
  qdFpAmericanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlContinuousArithmeticAsianVecerEngine"
  continuousArithmeticAsianVecerEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralCdsEngine"
  integralCdsEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralEngine"
  integralEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlJamshidianSwaptionEngine"
  jamshidianSwaptionEngine'_ :: ((C2HSImp.Ptr (COneFactorAffineModel')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dSwaptionEngine"
  gaussian1dSwaptionEngine'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dNonstandardSwaptionEngine"
  gaussian1dNonstandardSwaptionEngine'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dFloatFloatSwaptionEngine"
  gaussian1dFloatFloatSwaptionEngine'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dJamshidianSwaptionEngine"
  gaussian1dJamshidianSwaptionEngine'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlJuQuadraticApproximationEngine"
  juQuadraticApproximationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlKirkEngine"
  kirkEngine'_ :: ((C2HSImp.Ptr (CBlackProcess')) -> ((C2HSImp.Ptr (CBlackProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMidPointCdsEngine"
  midPointCdsEngine'_ :: ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMidPointCDOEngine"
  midPointCdoEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralCDOEngine"
  integralCdoEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralNtdEngine"
  integralNtdEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIsdaCdsEngine"
  isdaCdsEngine'_ :: ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlReplicatingVarianceSwapEngine"
  replicatingVarianceSwapEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlStulzEngine"
  stulzEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBjerksundStenslandSpreadEngine"
  bjerksundStenslandSpreadEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlOperatorSplittingSpreadEngine"
  operatorSplittingSpreadEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlPearsonSpreadEngine"
  pearsonSpreadEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussianCopulaSpreadEngine"
  gaussianCopulaSpreadEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlChoiBasketEngine"
  qlChoiBasketEngine'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDengLiZhouBasketEngine"
  qlDengLiZhouBasketEngine'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSingleFactorBsmBasketEngine"
  qlSingleFactorBsmBasketEngine'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlLfmSwaptionEngine"
  lfmSwaptionEngine'_ :: ((C2HSImp.Ptr (CLiborForwardModel')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCapFloorEngine1"
  treeCapFloorEngineTimeGrid'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeSwaptionEngine1"
  treeSwaptionEngineTimeGrid'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeVanillaSwapEngine1"
  treeVanillaSwapEngineTimeGrid'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdmQuantoHelper"
  fdmQuantoHelper'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFdmQuantoHelper)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdmQuantoHelperQuantoAdjustment"
  quantoAdjustment'_ :: ((C2HSImp.Ptr (CFdmQuantoHelper)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFd2dBlackScholesVanillaEngine"
  fd2dBlackScholesVanillaEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdndimBlackScholesVanillaEngine"
  qlFdndimBlackScholesVanillaEngine'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdndimBlackScholesVanillaEngine1"
  qlFdndimBlackScholesVanillaEngine1'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdG2SwaptionEngine"
  fdG2SwaptionEngine'_ :: ((C2HSImp.Ptr (CG2')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHullWhiteSwaptionEngine"
  fdHullWhiteSwaptionEngine'_ :: ((C2HSImp.Ptr (CHullWhite')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesBarrierEngine"
  fdBlackScholesBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonBarrierEngine"
  fdHestonBarrierEngineNoDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonBarrierEngine1"
  fdHestonBarrierEngineWithDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonDoubleBarrierEngine"
  fdHestonDoubleBarrierEngine'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCHestonHullWhiteEngine1"
  mcHestonHullWhiteEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CHybridHestonHullWhiteProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCAmericanEngine1"
  mcAmericanEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCBarrierEngine1"
  mcBarrierEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDigitalEngine1"
  mcDigitalEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteArithmeticAPEngine1"
  mcDiscreteArithmeticApEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteArithmeticASEngine1"
  mcDiscreteArithmeticAsEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteGeometricAPEngine1"
  mcDiscreteGeometricApEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteArithmeticAPHestonEngine1"
  mcDiscreteArithmeticApHestonEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteGeometricAPHestonEngine1"
  mcDiscreteGeometricApHestonEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanEngine1"
  mcEuropeanEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanGJRGARCHEngine1"
  mcEuropeanGjrGarchEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGJRGARCHProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanHestonEngine1"
  mcEuropeanHestonEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralHestonVarianceOptionEngine"
  integralHestonVarianceOptionEngine'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCHullWhiteCapFloorEngine1"
  mcHullWhiteCapFloorEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CHullWhite')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCHimalayaEngine1"
  mcHimalayaEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CStochasticProcessArray')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCPagodaEngine1"
  mcPagodaEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CStochasticProcessArray')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanBasketEngine1"
  mcEuropeanBasketEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CStochasticProcessArray')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEverestEngine1"
  mcEverestEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CStochasticProcessArray')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCAmericanBasketEngine1"
  mcAmericanBasketEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CStochasticProcessArray')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCPerformanceEngine1"
  mcPerformanceEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCVarianceSwapEngine1"
  mcVarianceSwapEngine'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialVanillaEngine"
  binomialVanillaEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesAsianEngine"
  fdBlackScholesAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine"
  fdBlackScholesVanillaEngineNoDividends'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine1"
  fdBlackScholesVanillaEngineWithDividends'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine2"
  fdBlackScholesVanillaEngineQuantoNoDividends'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CFdmQuantoHelper)) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine3"
  fdBlackScholesVanillaEngineQuantoWithDividends'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> ((C2HSImp.Ptr (CFdmQuantoHelper)) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine"
  fdHestonVanillaEngineNoDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine1"
  fdHestonVanillaEngineWithDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlCOSHestonEngine"
  cosHestonEngine'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticPDFHestonEngine"
  analyticPdfHestonEngine'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBatesVanillaEngine"
  fdBatesVanillaEngineNoDividends'_ :: ((C2HSImp.Ptr (CBatesModel')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBatesVanillaEngine1"
  fdBatesVanillaEngineWithDividends'_ :: ((C2HSImp.Ptr (CBatesModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesShoutEngine"
  fdBlackScholesShoutEngineNoDividends'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesShoutEngine1"
  fdBlackScholesShoutEngineWithDividends'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine2"
  fdHestonVanillaEngineQuantoNoDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CFdmQuantoHelper)) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine3"
  fdHestonVanillaEngineQuantoWithDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> ((C2HSImp.Ptr (CFdmQuantoHelper)) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonHullWhiteVanillaEngine"
  fdHestonHullWhiteVanillaEngineNoDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CHullWhiteProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonHullWhiteVanillaEngine1"
  fdHestonHullWhiteVanillaEngineWithDividends'_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CHullWhiteProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialConvertibleEngine"
  binomialConvertibleEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableFixedRateBondEngine1"
  blackCallableFixedRateBondEngineFromVolatilityStructure'_ :: ((C2HSImp.Ptr (CCallableBondVolatilityStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableFixedRateBondEngine"
  blackCallableFixedRateBondEngine'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableZeroCouponBondEngine1"
  blackCallableZeroCouponBondEngineFromVolatilityStructure'_ :: ((C2HSImp.Ptr (CCallableBondVolatilityStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableZeroCouponBondEngine"
  blackCallableZeroCouponBondEngine'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableFixedRateBondEngine1"
  treeCallableFixedRateBondEngineTimeGrid'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableFixedRateBondEngine"
  treeCallableFixedRateBondEngineTimeSteps'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableZeroCouponBondEngine1"
  treeCallableZeroCouponBondEngineTimeGrid'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableZeroCouponBondEngine"
  treeCallableZeroCouponBondEngineTimeSteps'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorAlpha"
  qlBlackCalculatorAlpha'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorBeta"
  qlBlackCalculatorBeta'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculator1"
  blackCalculatorAtStrikeRaw'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackCalculator')))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculator"
  blackCalculatorFromPayoffRaw'_ :: ((QlStrikedTypePayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackCalculator'))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorDelta"
  qlBlackCalculatorDelta'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorDeltaForward"
  qlBlackCalculatorDeltaForward'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorDividendRho"
  qlBlackCalculatorDividendRho'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorElasticity"
  qlBlackCalculatorElasticity'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorElasticityForward"
  qlBlackCalculatorElasticityForward'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorGamma"
  qlBlackCalculatorGamma'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorGammaForward"
  qlBlackCalculatorGammaForward'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorItmAssetProbability"
  qlBlackCalculatorItmAssetProbability'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorItmCashProbability"
  qlBlackCalculatorItmCashProbability'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorRho"
  qlBlackCalculatorRho'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorStrikeSensitivity"
  qlBlackCalculatorStrikeSensitivity'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorStrikeGamma"
  qlBlackCalculatorStrikeGamma'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorTheta"
  qlBlackCalculatorTheta'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorThetaPerDay"
  qlBlackCalculatorThetaPerDay'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorValue"
  qlBlackCalculatorValue'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorVanna"
  blackVanna'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorVega"
  qlBlackCalculatorVega'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorVolga"
  qlBlackCalculatorVolga'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculator1"
  blackScholesCalculatorAtStrikeRaw'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackScholesCalculator'))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculator"
  blackScholesCalculatorFromPayoffRaw'_ :: ((QlStrikedTypePayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackScholesCalculator')))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorDelta"
  blackScholesDelta'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorElasticity"
  blackScholesElasticity'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorGamma"
  blackScholesGamma'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorTheta"
  blackScholesTheta'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorThetaPerDay"
  blackScholesThetaPerDay'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculator1"
  bachelierCalculatorAtStrikeRaw'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBachelierCalculator)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculator"
  bachelierCalculatorFromPayoffRaw'_ :: ((QlStrikedTypePayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBachelierCalculator))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorAlpha"
  qlBachelierCalculatorAlpha'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorBeta"
  qlBachelierCalculatorBeta'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorDelta"
  qlBachelierCalculatorDelta'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorDeltaForward"
  qlBachelierCalculatorDeltaForward'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorDividendRho"
  qlBachelierCalculatorDividendRho'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorElasticity"
  qlBachelierCalculatorElasticity'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorElasticityForward"
  qlBachelierCalculatorElasticityForward'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorGamma"
  qlBachelierCalculatorGamma'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorGammaForward"
  qlBachelierCalculatorGammaForward'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorItmAssetProbability"
  qlBachelierCalculatorItmAssetProbability'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorItmCashProbability"
  qlBachelierCalculatorItmCashProbability'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorRho"
  qlBachelierCalculatorRho'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorStrikeSensitivity"
  qlBachelierCalculatorStrikeSensitivity'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorStrikeGamma"
  qlBachelierCalculatorStrikeGamma'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorTheta"
  qlBachelierCalculatorTheta'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorThetaPerDay"
  qlBachelierCalculatorThetaPerDay'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorValue"
  qlBachelierCalculatorValue'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorVanna"
  bachelierVanna'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorVega"
  qlBachelierCalculatorVega'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorVolga"
  qlBachelierCalculatorVolga'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculator"
  blackDeltaCalculator'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackDeltaCalculator))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculatorDeltaFromStrike"
  deltaFromStrike'_ :: ((C2HSImp.Ptr (CBlackDeltaCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculatorStrikeFromDelta"
  strikeFromDelta'_ :: ((C2HSImp.Ptr (CBlackDeltaCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculatorAtmStrike"
  atmStrike'_ :: ((C2HSImp.Ptr (CBlackDeltaCalculator)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormula"
  blackFormula'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaCashItmProbability"
  blackCashItmProbability'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDev"
  blackImpliedStdDev'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDevApproximation"
  blackImpliedStdDevApproximation'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaStdDevDerivative"
  blackStdDevDerivative'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaVolDerivative"
  blackVolDerivative'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormula"
  bachelierBlackFormula'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaForwardDerivative"
  blackForwardDerivative'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDevChambers"
  blackImpliedStdDevChambers'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDevApproximationRS"
  blackImpliedStdDevApproximationRs'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDevLiRS"
  blackImpliedStdDevLiRs'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaAssetItmProbability"
  blackAssetItmProbability'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaStdDevSecondDerivative"
  blackStdDevSecondDerivative'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormulaForwardDerivative"
  bachelierForwardDerivative'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormulaImpliedVol"
  bachelierImpliedVol'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormulaImpliedVolChoi"
  bachelierImpliedVolChoi'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormulaStdDevDerivative"
  bachelierStdDevDerivative'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormulaAssetItmProbability"
  bachelierAssetItmProbability'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibDefaultThetaPerDay"
  defaultThetaPerDay'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeSabrLogNormalVolatility"
  unsafeSabrLogNormalVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeShiftedSabrVolatility"
  unsafeShiftedSabrVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeSabrNormalVolatility"
  unsafeSabrNormalVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeSabrVolatility"
  unsafeSabrVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSabrVolatility"
  sabrVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlShiftedSabrVolatility"
  shiftedSabrVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSabrFlochKennedyVolatility"
  sabrFlochKennedyVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlValidateSabrParameters"
  validateSabrParameters'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))))

foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSabrGuess"
  sabrGuess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))))))))