never executed always true always false
    1 -- GENERATED by C->Haskell Compiler, version 0.28.8 Switcheroo, 25 November 2017 (Haskell)
    2 -- Edit the ORIGNAL .chs file instead!
    3 
    4 
    5 module QuantLib.PricingEngine
    6   (
    7     PricingEngine
    8   , BlackCalculator
    9   , BlackScholesCalculator
   10   , BachelierCalculator
   11   , BlackDeltaCalculator
   12   , CashAnnuityModel(..)
   13   , Probabilities(..)
   14   , CashDividendModel(..)
   15   , NumericalFix(..)
   16   , AccrualBias(..)
   17   , ForwardsInCouponPeriod(..)
   18   , FdmQuantoHelper
   19 
   20   , GenBlackCalculator
   21   , asBlackCalculator
   22 
   23   , discountingBondEngine
   24   , riskyBondEngine
   25   , discountingSwapEngine
   26   , discountingFxForwardEngine
   27   , discountingConstNotionalCrossCurrencySwapEngine
   28   , counterpartyAdjSwapEngine
   29 
   30   , analyticBarrierEngine
   31   , analyticTwoAssetBarrierEngine
   32   , analyticSoftBarrierEngine
   33   , analyticPartialTimeBarrierOptionEngine
   34   , analyticBinaryBarrierEngine
   35   , analyticSimpleChooserEngine
   36   , analyticTwoAssetCorrelationEngine
   37   , analyticWriterExtensibleOptionEngine
   38   , fdBlackScholesBarrierEngine
   39   , fdHestonBarrierEngine
   40   , fdHestonBarrierEngine'
   41   , binomialBarrierEngine
   42   , vannaVolgaBarrierEngine
   43   , analyticDoubleBarrierEngine
   44   , fdHestonDoubleBarrierEngine
   45   , vannaVolgaDoubleBarrierEngine
   46   , binomialDoubleBarrierEngine
   47   , mcDoubleBarrierEngine
   48   , analyticCliquetEngine
   49   , analyticCompoundOptionEngine
   50   , analyticContinuousFixedLookbackEngine
   51   , analyticContinuousFloatingLookbackEngine
   52   , analyticContinuousGeometricAveragePriceAsianEngine
   53   , analyticDigitalAmericanEngine
   54   , analyticDigitalAmericanKOEngine
   55   , analyticDiscreteGeometricAveragePriceAsianEngine
   56   , analyticDiscreteGeometricAverageStrikeAsianEngine
   57   , turnbullWakemanAsianEngine
   58   , fdBlackScholesAsianEngine
   59   , analyticDividendEuropeanEngine
   60   , analyticEuropeanEngine
   61   , analyticPerformanceEngine
   62   , forwardEuropeanEngine
   63   , forwardBaroneAdesiWhaleyEngine
   64   , forwardBjerksundStenslandEngine
   65   , forwardFdBlackScholesVanillaEngine
   66   , mcForwardEuropeanBSEngine
   67   , analyticHestonForwardEuropeanEngine
   68   , quantoEuropeanEngine
   69   , quantoForwardEuropeanEngine
   70   , quantoForwardPerformanceEuropeanEngine
   71   , quantoBarrierEngine
   72   , quantoDoubleBarrierEngine
   73   , blackCapFloorEngine'
   74   , blackCapFloorEngine
   75   , blackSwaptionEngine
   76   , blackSwaptionEngine'
   77   , bachelierCapFloorEngine'
   78   , bachelierCapFloorEngine
   79   , yoyInflationBlackCapFloorEngine
   80   , yoyInflationUnitDisplacedBlackCapFloorEngine
   81   , yoyInflationBachelierCapFloorEngine
   82   , interpolatingCPICapFloorEngine
   83   , bachelierSwaptionEngine
   84   , bachelierSwaptionEngine'
   85   , analyticBSMHullWhiteEngine
   86   , analyticCapFloorEngine
   87   , gaussian1dCapFloorEngine
   88   , analyticGJRGARCHEngine
   89   , analyticHestonEngine
   90   , analyticHestonHullWhiteEngine
   91   , batesEngine
   92   , fftVanillaEngine
   93   , g2SwaptionEngine
   94   , jumpDiffusionEngine
   95   , treeCapFloorEngine
   96   , treeSwaptionEngine
   97   , treeVanillaSwapEngine
   98   , varianceGammaEngine
   99   , analyticHestonEngine'
  100   , analyticHestonHullWhiteEngine'
  101   , batesEngine'
  102   , mcHestonHullWhiteEngine
  103   , mcAmericanEngine
  104   , mcBarrierEngine
  105   , mcDigitalEngine
  106   , mcDiscreteArithmeticAPEngine
  107   , mcDiscreteArithmeticASEngine
  108   , mcDiscreteGeometricAPEngine
  109   , mcEuropeanEngine
  110   , mcEuropeanGJRGARCHEngine
  111   , mcEuropeanHestonEngine
  112   , integralHestonVarianceOptionEngine
  113   , mcHullWhiteCapFloorEngine
  114   , mcHimalayaEngine
  115   , mcPagodaEngine
  116   , mcEuropeanBasketEngine
  117   , mcAmericanBasketEngine
  118   , mcPerformanceEngine
  119   , mcVarianceSwapEngine
  120   , baroneAdesiWhaleyApproximationEngine
  121   , batesDetJumpEngine'
  122   , batesDetJumpEngine
  123   , batesDoubleExpDetJumpEngine'
  124   , batesDoubleExpDetJumpEngine
  125   , batesDoubleExpEngine'
  126   , batesDoubleExpEngine
  127   , bjerksundStenslandApproximationEngine
  128   , integralCdsEngine
  129   , integralEngine
  130   , isdaCdsEngine
  131   , jamshidianSwaptionEngine
  132   , gaussian1dSwaptionEngine
  133   , gaussian1dNonstandardSwaptionEngine
  134   , gaussian1dFloatFloatSwaptionEngine
  135   , gaussian1dJamshidianSwaptionEngine
  136   , juQuadraticApproximationEngine
  137   , kirkEngine
  138   , midPointCdsEngine
  139   , replicatingVarianceSwapEngine
  140   , stulzEngine
  141   , lfmSwaptionEngine
  142   , treeCapFloorEngine'
  143   , treeSwaptionEngine'
  144   , treeVanillaSwapEngine'
  145 
  146   , fdG2SwaptionEngine
  147   , fdHullWhiteSwaptionEngine
  148   , binomialVanillaEngine
  149   , fdBlackScholesVanillaEngine
  150   , fdBlackScholesVanillaEngine'
  151   , fdBlackScholesVanillaEngineQuanto
  152   , fdBlackScholesVanillaEngineQuanto'
  153   , fdmQuantoHelper
  154   , fdmQuantoHelperQuantoAdjustment
  155   , fdHestonVanillaEngine
  156   , fdHestonVanillaEngine'
  157   , fdHestonVanillaEngineQuanto
  158   , fdHestonVanillaEngineQuanto'
  159   , fdHestonHullWhiteVanillaEngine
  160   , fdHestonHullWhiteVanillaEngine'
  161 
  162   , binomialConvertibleEngine
  163   , blackCallableFixedRateBondEngine'
  164   , blackCallableFixedRateBondEngine
  165   , blackCallableZeroCouponBondEngine'
  166   , blackCallableZeroCouponBondEngine
  167   , treeCallableFixedRateBondEngine'
  168   , treeCallableFixedRateBondEngine
  169   , treeCallableZeroCouponBondEngine'
  170   , treeCallableZeroCouponBondEngine
  171 
  172   , alpha
  173   , beta
  174   , blackCalculator'
  175   , blackCalculator
  176   , blackDelta
  177   , deltaForward
  178   , dividendRho
  179   , blackElasticity
  180   , elasticityForward
  181   , blackGamma
  182   , gammaForward
  183   , itmAssetProbability
  184   , itmCashProbability
  185   , rho
  186   , strikeSensitivity
  187   , strikeGamma
  188   , blackTheta
  189   , blackThetaPerDay
  190   , value
  191   , vanna
  192   , vega
  193   , volga
  194   , blackScholesCalculator'
  195   , blackScholesCalculator
  196   , blackScholesDelta
  197   , blackScholesElasticity
  198   , blackScholesGamma
  199   , blackScholesTheta
  200   , blackScholesThetaPerDay
  201 
  202   , bachelierCalculator'
  203   , bachelierCalculator
  204   , bachelierAlpha
  205   , bachelierBeta
  206   , bachelierDelta
  207   , bachelierDeltaForward
  208   , bachelierDividendRho
  209   , bachelierElasticity
  210   , bachelierElasticityForward
  211   , bachelierGamma
  212   , bachelierGammaForward
  213   , bachelierItmAssetProbability
  214   , bachelierItmCashProbability
  215   , bachelierRho
  216   , bachelierStrikeSensitivity
  217   , bachelierStrikeGamma
  218   , bachelierTheta
  219   , bachelierThetaPerDay
  220   , bachelierValue
  221   , bachelierVanna
  222   , bachelierVega
  223   , bachelierVolga
  224 
  225   , blackDeltaCalculator
  226   , deltaFromStrike
  227   , strikeFromDelta
  228   , atmStrike
  229   , blackFormula'
  230   , blackFormula
  231   , blackCashItmProbability'
  232   , blackCashItmProbability
  233   , blackImpliedStdDev'
  234   , blackImpliedStdDev
  235   , blackImpliedStdDevApproximation'
  236   , blackImpliedStdDevApproximation
  237   , blackStdDevDerivative'
  238   , blackStdDevDerivative
  239   , blackVolDerivative
  240   , bachelierBlackFormula'
  241   , bachelierBlackFormula
  242   , defaultThetaPerDay
  243   , unsafeSabrLogNormalVolatility
  244   , unsafeShiftedSabrVolatility
  245   , unsafeSabrNormalVolatility
  246   , unsafeSabrVolatility
  247   , sabrVolatility
  248   , shiftedSabrVolatility
  249   , sabrFlochKennedyVolatility
  250   , validateSabrParameters
  251   , sabrGuess
  252   ) where
  253 import qualified Foreign.C.Types as C2HSImp
  254 import qualified Foreign.ForeignPtr as C2HSImp
  255 import qualified Foreign.Marshal.Utils as C2HSImp
  256 import qualified Foreign.Ptr as C2HSImp
  257 
  258 
  259 
  260 
  261 
  262 
  263 
  264 import QuantLib.Internal
  265 import QuantLib.Internal.Type
  266 import QuantLib.InterestRate(VolatilityType)
  267 import QuantLib.Math
  268 
  269 import QuantLib.Quote(DeltaType, AtmType)
  270 import QuantLib.Instrument.Option hiding(itmCashProbability, deltaForward, strikeSensitivity, dividendRho, rho, vega)
  271 import QuantLib.Internal.Common
  272 
  273 data CashAnnuityModel = SwapRate
  274                       | DiscountCurve
  275   deriving (Enum,Show,Eq,Read)
  276 
  277 
  278 data Probabilities = None
  279                    | Naive
  280                    | Digital
  281   deriving (Enum,Show,Eq,Read)
  282 
  283 
  284 data CashDividendModel = CashDividendSpot
  285                        | CashDividendEscrowed
  286   deriving (Enum,Show,Eq,Read)
  287 
  288 
  289 data NumericalFix = NumericalFixNone
  290                   | NumericalFixTaylor
  291   deriving (Enum,Show,Eq,Read)
  292 
  293 
  294 data AccrualBias = HalfDayBias
  295                  | NoBias
  296   deriving (Enum,Show,Eq,Read)
  297 
  298 
  299 data ForwardsInCouponPeriod = Flat
  300                             | Piecewise
  301   deriving (Enum,Show,Eq,Read)
  302 
  303 
  304 
  305 
  306 
  307 
  308 
  309 
  310 
  311 
  312 
  313 
  314 
  315 
  316 
  317 
  318 
  319 
  320 
  321 
  322 
  323 
  324 
  325 
  326 
  327 
  328 
  329 
  330 
  331 
  332 
  333 
  334 
  335 
  336 
  337 
  338 
  339 
  340 
  341 
  342 
  343 
  344 
  345 
  346 
  347 
  348 
  349 
  350 
  351 
  352 
  353 
  354 
  355 
  356 
  357 
  358 
  359 
  360 
  361 
  362 
  363 
  364 
  365 
  366 
  367 
  368 
  369 
  370 
  371 
  372 
  373 
  374 
  375 
  376 
  377 
  378 
  379 
  380 
  381 
  382 
  383 
  384 
  385 
  386 
  387 
  388 
  389 
  390 
  391 
  392 
  393 
  394 
  395 
  396 
  397 
  398 
  399 
  400 
  401 
  402 
  403 
  404 
  405 
  406 
  407 
  408 
  409 
  410 
  411 
  412 
  413 
  414 
  415 -- |discounts a bond's cash flows off a yield term structure
  416 discountingBondEngine :: (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
  417  -> IO ((PricingEngine))
  418 discountingBondEngine a1 a2 =
  419   withYieldTermStructure a1 $ \a1' -> 
  420   let {a2' = fromMaybeBool a2} in 
  421   preErrorCheck $ \a3' -> 
  422   discountingBondEngine'_ a1' a2' a3' >>= \res ->
  423   peekPricingEngine res >>= \res' ->
  424   errorCheck  a3'>>
  425   return (res')
  426 
  427 
  428 
  429 -- |discounts a bond's cash flows off a default-risky curve and a flat recovery rate
  430 riskyBondEngine :: (DefaultProbabilityTermStructure) -> (Double) -- ^recoveryRate
  431  -> (GenYieldTermStructure y) -> IO ((PricingEngine))
  432 riskyBondEngine a1 a2 a3 =
  433   withGenTermStructure a1 $ \a1' -> 
  434   let {a2' = realToFrac a2} in 
  435   withYieldTermStructure a3 $ \a3' -> 
  436   preErrorCheck $ \a4' -> 
  437   riskyBondEngine'_ a1' a2' a3' a4' >>= \res ->
  438   peekPricingEngine res >>= \res' ->
  439   errorCheck  a4'>>
  440   return (res')
  441 
  442 
  443 
  444 -- |discounts a swap's legs off a single discount curve
  445 discountingSwapEngine :: (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
  446  -> (Maybe Day) -- ^settlementDate
  447  -> (Maybe Day) -- ^npvDate
  448  -> IO ((PricingEngine))
  449 discountingSwapEngine a1 a2 a3 a4 =
  450   withYieldTermStructure a1 $ \a1' -> 
  451   let {a2' = fromMaybeBool a2} in 
  452   withMaybeDay a3 $ \a3' -> 
  453   withMaybeDay a4 $ \a4' -> 
  454   preErrorCheck $ \a5' -> 
  455   discountingSwapEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  456   peekPricingEngine res >>= \res' ->
  457   errorCheck  a5'>>
  458   return (res')
  459 
  460 
  461 
  462 -- |discounts an FX forward's two legs off their respective currency discount curves
  463 discountingFxForwardEngine :: (GenYieldTermStructure y1) -- ^sourceCurrencyDiscountCurve
  464  -> (GenYieldTermStructure y2) -- ^targetCurrencyDiscountCurve
  465  -> (GenQuote q) -- ^spotFx
  466  -> IO ((PricingEngine))
  467 discountingFxForwardEngine a1 a2 a3 =
  468   withYieldTermStructure a1 $ \a1' -> 
  469   withYieldTermStructure a2 $ \a2' -> 
  470   withQuote a3 $ \a3' -> 
  471   preErrorCheck $ \a4' -> 
  472   discountingFxForwardEngine'_ a1' a2' a3' a4' >>= \res ->
  473   peekPricingEngine res >>= \res' ->
  474   errorCheck  a4'>>
  475   return (res')
  476 
  477 
  478 
  479 -- |Discounts each leg of a 'QuantLib.Instrument.Swap.ConstNotionalCrossCurrencySwap' (or either
  480 -- of its two leaves) off its own currency's discount curve, converting to @domesticCcy@ via
  481 -- @spotFX@ (quoted as units of @domesticCcy@ per unit of @foreignCcy@, w.r.t. a settlement equal
  482 -- to the npv date unless @spotFXSettleDate@ says otherwise). Each leg's stored currency must equal
  483 -- @domesticCcy@ or @foreignCcy@; the two discount curves must share the same reference date.
  484 discountingConstNotionalCrossCurrencySwapEngine :: (Currency) -- ^domesticCcy
  485  -> (GenYieldTermStructure y1) -- ^domesticCcyDiscountCurve
  486  -> (Currency) -- ^foreignCcy
  487  -> (GenYieldTermStructure y2) -- ^foreignCcyDiscountCurve
  488  -> (GenQuote q) -- ^spotFX
  489  -> (Maybe Bool) -- ^includeSettlementDateFlows
  490  -> (Maybe Day) -- ^settlementDate
  491  -> (Maybe Day) -- ^npvDate
  492  -> (Maybe Day) -- ^spotFXSettleDate
  493  -> IO ((PricingEngine))
  494 discountingConstNotionalCrossCurrencySwapEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  495   withCurrency a1 $ \a1' -> 
  496   withYieldTermStructure a2 $ \a2' -> 
  497   withCurrency a3 $ \a3' -> 
  498   withYieldTermStructure a4 $ \a4' -> 
  499   withQuote a5 $ \a5' -> 
  500   let {a6' = fromMaybeBool a6} in 
  501   withMaybeDay a7 $ \a7' -> 
  502   withMaybeDay a8 $ \a8' -> 
  503   withMaybeDay a9 $ \a9' -> 
  504   preErrorCheck $ \a10' -> 
  505   discountingConstNotionalCrossCurrencySwapEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  506   peekPricingEngine res >>= \res' ->
  507   errorCheck  a10'>>
  508   return (res')
  509 
  510 
  511 
  512 -- | CVA/DVA-adjusted swap pricing engine. @invstDTS@\/@invstRecoveryRate@ are the
  513 -- own (investor-side) default probability curve and recovery rate for bilateral
  514 -- CVA\/DVA; pass 'Nothing' for @invstDTS@ and @0.999@ for @invstRecoveryRate@ to
  515 -- match upstream's unilateral-CVA-only defaults.
  516 counterpartyAdjSwapEngine :: (GenYieldTermStructure y) -- ^discountCurve
  517  -> (GenQuote q) -- ^blackVol
  518  -> (DefaultProbabilityTermStructure) -- ^ctptyDTS
  519  -> (Double) -- ^ctptyRecoveryRate
  520  -> (Maybe DefaultProbabilityTermStructure) -- ^invstDTS
  521  -> (Double) -- ^invstRecoveryRate
  522  -> IO ((PricingEngine))
  523 counterpartyAdjSwapEngine a1 a2 a3 a4 a5 a6 =
  524   withYieldTermStructure a1 $ \a1' -> 
  525   withQuote a2 $ \a2' -> 
  526   withGenTermStructure a3 $ \a3' -> 
  527   let {a4' = realToFrac a4} in 
  528   withMaybeDefaultProbabilityTermStructure a5 $ \a5' -> 
  529   let {a6' = realToFrac a6} in 
  530   preErrorCheck $ \a7' -> 
  531   counterpartyAdjSwapEngine'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  532   peekPricingEngine res >>= \res' ->
  533   errorCheck  a7'>>
  534   return (res')
  535 
  536 
  537 
  538 -- |analytic pricing engine for barrier options
  539 analyticBarrierEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  540 analyticBarrierEngine a1 =
  541   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  542   preErrorCheck $ \a2' -> 
  543   analyticBarrierEngine'_ a1' a2' >>= \res ->
  544   peekPricingEngine res >>= \res' ->
  545   errorCheck  a2'>>
  546   return (res')
  547 
  548 
  549 
  550 -- |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
  551 analyticTwoAssetBarrierEngine :: (GeneralizedBlackScholesProcess) -- ^process1
  552  -> (GeneralizedBlackScholesProcess) -- ^process2
  553  -> (GenQuote q) -- ^rho
  554  -> IO ((PricingEngine))
  555 analyticTwoAssetBarrierEngine a1 a2 a3 =
  556   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  557   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  558   withQuote a3 $ \a3' -> 
  559   preErrorCheck $ \a4' -> 
  560   analyticTwoAssetBarrierEngine'_ a1' a2' a3' a4' >>= \res ->
  561   peekPricingEngine res >>= \res' ->
  562   errorCheck  a4'>>
  563   return (res')
  564 
  565 
  566 
  567 -- |analytic pricing engine for soft barrier options, knocked in/out proportionally over a barrier range
  568 analyticSoftBarrierEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  569 analyticSoftBarrierEngine a1 =
  570   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  571   preErrorCheck $ \a2' -> 
  572   analyticSoftBarrierEngine'_ a1' a2' >>= \res ->
  573   peekPricingEngine res >>= \res' ->
  574   errorCheck  a2'>>
  575   return (res')
  576 
  577 
  578 
  579 -- |analytic pricing engine for simple chooser options
  580 analyticSimpleChooserEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  581 analyticSimpleChooserEngine a1 =
  582   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  583   preErrorCheck $ \a2' -> 
  584   analyticSimpleChooserEngine'_ a1' a2' >>= \res ->
  585   peekPricingEngine res >>= \res' ->
  586   errorCheck  a2'>>
  587   return (res')
  588 
  589 
  590 
  591 -- |analytic pricing engine for two-asset correlation options
  592 analyticTwoAssetCorrelationEngine :: (GeneralizedBlackScholesProcess) -- ^process1
  593  -> (GeneralizedBlackScholesProcess) -- ^process2
  594  -> (GenQuote q) -- ^correlation
  595  -> IO ((PricingEngine))
  596 analyticTwoAssetCorrelationEngine a1 a2 a3 =
  597   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  598   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  599   withQuote a3 $ \a3' -> 
  600   preErrorCheck $ \a4' -> 
  601   analyticTwoAssetCorrelationEngine'_ a1' a2' a3' a4' >>= \res ->
  602   peekPricingEngine res >>= \res' ->
  603   errorCheck  a4'>>
  604   return (res')
  605 
  606 
  607 
  608 -- |analytic pricing engine for writer-extensible options
  609 analyticWriterExtensibleOptionEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  610 analyticWriterExtensibleOptionEngine a1 =
  611   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  612   preErrorCheck $ \a2' -> 
  613   analyticWriterExtensibleOptionEngine'_ a1' a2' >>= \res ->
  614   peekPricingEngine res >>= \res' ->
  615   errorCheck  a2'>>
  616   return (res')
  617 
  618 
  619 
  620 -- |analytic pricing engine for partial-time barrier options
  621 analyticPartialTimeBarrierOptionEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  622 analyticPartialTimeBarrierOptionEngine a1 =
  623   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  624   preErrorCheck $ \a2' -> 
  625   analyticPartialTimeBarrierOptionEngine'_ a1' a2' >>= \res ->
  626   peekPricingEngine res >>= \res' ->
  627   errorCheck  a2'>>
  628   return (res')
  629 
  630 
  631 
  632 -- |analytic pricing engine for American binary barrier options (cash-or-nothing/asset-or-nothing)
  633 analyticBinaryBarrierEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  634 analyticBinaryBarrierEngine a1 =
  635   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  636   preErrorCheck $ \a2' -> 
  637   analyticBinaryBarrierEngine'_ a1' a2' >>= \res ->
  638   peekPricingEngine res >>= \res' ->
  639   errorCheck  a2'>>
  640   return (res')
  641 
  642 
  643 
  644 -- |/NB/ Timesteps for Cox-Ross-Rubinstein trees are adjusted using the Boyle-Lau algorithm;
  645 -- pass @maxTimeSteps = timeSteps@ to disable it, or @0@ to use the library's default heuristic.
  646 binomialBarrierEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
  647  -> (Word) -- ^maxTimeSteps
  648  -> IO ((PricingEngine))
  649 binomialBarrierEngine a1 a2 a3 a4 =
  650   let {a1' = (fromIntegral . fromEnum) a1} in 
  651   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  652   let {a3' = fromIntegral a3} in 
  653   let {a4' = fromIntegral a4} in 
  654   preErrorCheck $ \a5' -> 
  655   binomialBarrierEngine'_ a1' a2' a3' a4' a5' >>= \res ->
  656   peekPricingEngine res >>= \res' ->
  657   errorCheck  a5'>>
  658   return (res')
  659 
  660 
  661 
  662 -- |FX barrier option engine using the vanna-volga method to account for the volatility smile
  663 vannaVolgaBarrierEngine :: (DeltaVolQuote) -- ^atmVol
  664  -> (DeltaVolQuote) -- ^vol25Put
  665  -> (DeltaVolQuote) -- ^vol25Call
  666  -> (GenQuote q) -- ^spotFX
  667  -> (GenYieldTermStructure y1) -- ^domesticTS
  668  -> (GenYieldTermStructure y2) -- ^foreignTS
  669  -> (Bool) -- ^adaptVanDelta
  670  -> (Double) -- ^bsPriceWithSmile
  671  -> IO ((PricingEngine))
  672 vannaVolgaBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 =
  673   withGenQuote a1 $ \a1' -> 
  674   withGenQuote a2 $ \a2' -> 
  675   withGenQuote a3 $ \a3' -> 
  676   withQuote a4 $ \a4' -> 
  677   withYieldTermStructure a5 $ \a5' -> 
  678   withYieldTermStructure a6 $ \a6' -> 
  679   let {a7' = C2HSImp.fromBool a7} in 
  680   let {a8' = realToFrac a8} in 
  681   preErrorCheck $ \a9' -> 
  682   vannaVolgaBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  683   peekPricingEngine res >>= \res' ->
  684   errorCheck  a9'>>
  685   return (res')
  686 
  687 
  688 
  689 -- |analytic pricing engine for double-barrier European options
  690 analyticDoubleBarrierEngine :: (GeneralizedBlackScholesProcess) -> (Int) -- ^series
  691  -> IO ((PricingEngine))
  692 analyticDoubleBarrierEngine a1 a2 =
  693   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  694   let {a2' = fromIntegral a2} in 
  695   preErrorCheck $ \a3' -> 
  696   analyticDoubleBarrierEngine'_ a1' a2' a3' >>= \res ->
  697   peekPricingEngine res >>= \res' ->
  698   errorCheck  a3'>>
  699   return (res')
  700 
  701 
  702 
  703 -- |always uses 'AnalyticDoubleBarrierEngine' as the underlying smile-free double-barrier engine
  704 vannaVolgaDoubleBarrierEngine :: (DeltaVolQuote) -- ^atmVol
  705  -> (DeltaVolQuote) -- ^vol25Put
  706  -> (DeltaVolQuote) -- ^vol25Call
  707  -> (GenQuote q) -- ^spotFX
  708  -> (GenYieldTermStructure y1) -- ^domesticTS
  709  -> (GenYieldTermStructure y2) -- ^foreignTS
  710  -> (Bool) -- ^adaptVanDelta
  711  -> (Double) -- ^bsPriceWithSmile
  712  -> (Int) -- ^series
  713  -> IO ((PricingEngine))
  714 vannaVolgaDoubleBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  715   withGenQuote a1 $ \a1' -> 
  716   withGenQuote a2 $ \a2' -> 
  717   withGenQuote a3 $ \a3' -> 
  718   withQuote a4 $ \a4' -> 
  719   withYieldTermStructure a5 $ \a5' -> 
  720   withYieldTermStructure a6 $ \a6' -> 
  721   let {a7' = C2HSImp.fromBool a7} in 
  722   let {a8' = realToFrac a8} in 
  723   let {a9' = fromIntegral a9} in 
  724   preErrorCheck $ \a10' -> 
  725   vannaVolgaDoubleBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
  726   peekPricingEngine res >>= \res' ->
  727   errorCheck  a10'>>
  728   return (res')
  729 
  730 
  731 
  732 -- |pricing engine for double-barrier options using binomial trees
  733 binomialDoubleBarrierEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
  734  -> IO ((PricingEngine))
  735 binomialDoubleBarrierEngine a1 a2 a3 =
  736   let {a1' = (fromIntegral . fromEnum) a1} in 
  737   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
  738   let {a3' = fromIntegral a3} in 
  739   preErrorCheck $ \a4' -> 
  740   binomialDoubleBarrierEngine'_ a1' a2' a3' a4' >>= \res ->
  741   peekPricingEngine res >>= \res' ->
  742   errorCheck  a4'>>
  743   return (res')
  744 
  745 
  746 
  747 -- |Monte Carlo pricing engine for double-barrier options
  748 mcDoubleBarrierEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
  749  -> (Maybe Word) -- ^timeStepsPerYear
  750  -> (Bool) -- ^brownianBridge
  751  -> (Bool) -- ^antitheticVariate
  752  -> (Maybe Word) -- ^requiredSamples
  753  -> (Maybe Double) -- ^requiredTolerance
  754  -> (Maybe Word) -- ^maxSamples
  755  -> (Word) -- ^seed
  756  -> IO ((PricingEngine))
  757 mcDoubleBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  758   let {a1' = (fromIntegral . fromEnum) a1} in 
  759   let {a2' = (fromIntegral . fromEnum) a2} in 
  760   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  761   let {a4' = fromMaybeInt a4} in 
  762   let {a5' = fromMaybeInt a5} in 
  763   let {a6' = C2HSImp.fromBool a6} in 
  764   let {a7' = C2HSImp.fromBool a7} in 
  765   let {a8' = fromMaybeInt a8} in 
  766   let {a9' = fromMaybeDouble a9} in 
  767   let {a10' = fromMaybeInt a10} in 
  768   let {a11' = fromIntegral a11} in 
  769   preErrorCheck $ \a12' -> 
  770   mcDoubleBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  771   peekPricingEngine res >>= \res' ->
  772   errorCheck  a12'>>
  773   return (res')
  774 
  775 
  776 
  777 -- |analytic pricing engine for Cliquet (ratchet) options
  778 analyticCliquetEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  779 analyticCliquetEngine a1 =
  780   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  781   preErrorCheck $ \a2' -> 
  782   analyticCliquetEngine'_ a1' a2' >>= \res ->
  783   peekPricingEngine res >>= \res' ->
  784   errorCheck  a2'>>
  785   return (res')
  786 
  787 
  788 
  789 -- |analytic pricing engine for compound options
  790 analyticCompoundOptionEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  791 analyticCompoundOptionEngine a1 =
  792   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  793   preErrorCheck $ \a2' -> 
  794   analyticCompoundOptionEngine'_ a1' a2' >>= \res ->
  795   peekPricingEngine res >>= \res' ->
  796   errorCheck  a2'>>
  797   return (res')
  798 
  799 
  800 
  801 -- |analytic pricing engine for European continuous fixed-strike lookback options
  802 analyticContinuousFixedLookbackEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  803 analyticContinuousFixedLookbackEngine a1 =
  804   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  805   preErrorCheck $ \a2' -> 
  806   analyticContinuousFixedLookbackEngine'_ a1' a2' >>= \res ->
  807   peekPricingEngine res >>= \res' ->
  808   errorCheck  a2'>>
  809   return (res')
  810 
  811 
  812 
  813 -- |analytic pricing engine for European continuous floating-strike lookback options
  814 analyticContinuousFloatingLookbackEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  815 analyticContinuousFloatingLookbackEngine a1 =
  816   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  817   preErrorCheck $ \a2' -> 
  818   analyticContinuousFloatingLookbackEngine'_ a1' a2' >>= \res ->
  819   peekPricingEngine res >>= \res' ->
  820   errorCheck  a2'>>
  821   return (res')
  822 
  823 
  824 
  825 -- |analytic pricing engine for European continuous geometric average-price Asian options
  826 analyticContinuousGeometricAveragePriceAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  827 analyticContinuousGeometricAveragePriceAsianEngine a1 =
  828   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  829   preErrorCheck $ \a2' -> 
  830   analyticContinuousGeometricAveragePriceAsianEngine'_ a1' a2' >>= \res ->
  831   peekPricingEngine res >>= \res' ->
  832   errorCheck  a2'>>
  833   return (res')
  834 
  835 
  836 
  837 -- |analytic pricing engine for American digital (cash-or-nothing/asset-or-nothing) options
  838 analyticDigitalAmericanEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  839 analyticDigitalAmericanEngine a1 =
  840   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  841   preErrorCheck $ \a2' -> 
  842   analyticDigitalAmericanEngine'_ a1' a2' >>= \res ->
  843   peekPricingEngine res >>= \res' ->
  844   errorCheck  a2'>>
  845   return (res')
  846 
  847 
  848 
  849 -- |analytic pricing engine for American knock-out digital (cash-or-nothing/asset-or-nothing) options
  850 analyticDigitalAmericanKOEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  851 analyticDigitalAmericanKOEngine a1 =
  852   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  853   preErrorCheck $ \a2' -> 
  854   analyticDigitalAmericanKOEngine'_ a1' a2' >>= \res ->
  855   peekPricingEngine res >>= \res' ->
  856   errorCheck  a2'>>
  857   return (res')
  858 
  859 
  860 
  861 -- |analytic pricing engine for European discrete geometric average-price Asian options
  862 analyticDiscreteGeometricAveragePriceAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  863 analyticDiscreteGeometricAveragePriceAsianEngine a1 =
  864   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  865   preErrorCheck $ \a2' -> 
  866   analyticDiscreteGeometricAveragePriceAsianEngine'_ a1' a2' >>= \res ->
  867   peekPricingEngine res >>= \res' ->
  868   errorCheck  a2'>>
  869   return (res')
  870 
  871 
  872 
  873 -- |analytic pricing engine for European discrete geometric average-strike Asian options
  874 analyticDiscreteGeometricAverageStrikeAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  875 analyticDiscreteGeometricAverageStrikeAsianEngine a1 =
  876   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  877   preErrorCheck $ \a2' -> 
  878   analyticDiscreteGeometricAverageStrikeAsianEngine'_ a1' a2' >>= \res ->
  879   peekPricingEngine res >>= \res' ->
  880   errorCheck  a2'>>
  881   return (res')
  882 
  883 
  884 
  885 -- |Turnbull-Wakeman moment-matching pricing engine for discrete arithmetic average-price\/-strike Asian options
  886 turnbullWakemanAsianEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  887 turnbullWakemanAsianEngine a1 =
  888   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  889   preErrorCheck $ \a2' -> 
  890   turnbullWakemanAsianEngine'_ a1' a2' >>= \res ->
  891   peekPricingEngine res >>= \res' ->
  892   errorCheck  a2'>>
  893   return (res')
  894 
  895 
  896 
  897 -- |analytic pricing engine for European options with discrete dividends
  898 analyticDividendEuropeanEngine :: (GeneralizedBlackScholesProcess) -> ([Dividend]) -> IO ((PricingEngine))
  899 analyticDividendEuropeanEngine a1 a2 =
  900   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  901   withDividendArray a2 $ \(a2'1, a2'2) -> 
  902   preErrorCheck $ \a3' -> 
  903   analyticDividendEuropeanEngine'_ a1' a2'1  a2'2 a3' >>= \res ->
  904   peekPricingEngine res >>= \res' ->
  905   errorCheck  a3'>>
  906   return (res')
  907 
  908 
  909 
  910 -- |analytic Black-Scholes pricing engine for European options
  911 analyticEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
  912  -> IO ((PricingEngine))
  913 analyticEuropeanEngine a1 a2 =
  914   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  915   withMaybeYieldTermStructure a2 $ \a2' -> 
  916   preErrorCheck $ \a3' -> 
  917   analyticEuropeanEngine'_ a1' a2' a3' >>= \res ->
  918   peekPricingEngine res >>= \res' ->
  919   errorCheck  a3'>>
  920   return (res')
  921 
  922 
  923 
  924 -- |analytic pricing engine for performance (return) options
  925 analyticPerformanceEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  926 analyticPerformanceEngine a1 =
  927   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  928   preErrorCheck $ \a2' -> 
  929   analyticPerformanceEngine'_ a1' a2' >>= \res ->
  930   peekPricingEngine res >>= \res' ->
  931   errorCheck  a2'>>
  932   return (res')
  933 
  934 
  935 
  936 -- |analytic pricing engine for forward-starting European options; binds the @AnalyticEuropeanEngine@ instantiation of upstream's @ForwardVanillaEngine\<Engine\>@ template
  937 forwardEuropeanEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  938 forwardEuropeanEngine a1 =
  939   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  940   preErrorCheck $ \a2' -> 
  941   forwardEuropeanEngine'_ a1' a2' >>= \res ->
  942   peekPricingEngine res >>= \res' ->
  943   errorCheck  a2'>>
  944   return (res')
  945 
  946 
  947 
  948 -- |Barone-Adesi\/Whaley approximation pricing engine for forward-starting American options; binds the @BaroneAdesiWhaleyApproximationEngine@ instantiation of @ForwardVanillaEngine\<Engine\>@
  949 forwardBaroneAdesiWhaleyEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  950 forwardBaroneAdesiWhaleyEngine a1 =
  951   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  952   preErrorCheck $ \a2' -> 
  953   forwardBaroneAdesiWhaleyEngine'_ a1' a2' >>= \res ->
  954   peekPricingEngine res >>= \res' ->
  955   errorCheck  a2'>>
  956   return (res')
  957 
  958 
  959 
  960 -- |Bjerksund\/Stensland approximation pricing engine for forward-starting American options; binds the @BjerksundStenslandApproximationEngine@ instantiation of @ForwardVanillaEngine\<Engine\>@
  961 forwardBjerksundStenslandEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  962 forwardBjerksundStenslandEngine a1 =
  963   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  964   preErrorCheck $ \a2' -> 
  965   forwardBjerksundStenslandEngine'_ a1' a2' >>= \res ->
  966   peekPricingEngine res >>= \res' ->
  967   errorCheck  a2'>>
  968   return (res')
  969 
  970 
  971 
  972 -- |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\>@
  973 forwardFdBlackScholesVanillaEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
  974 forwardFdBlackScholesVanillaEngine a1 =
  975   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
  976   preErrorCheck $ \a2' -> 
  977   forwardFdBlackScholesVanillaEngine'_ a1' a2' >>= \res ->
  978   peekPricingEngine res >>= \res' ->
  979   errorCheck  a2'>>
  980   return (res')
  981 
  982 
  983 
  984 -- |Monte Carlo pricing engine for forward-starting European options under a Black-Scholes process
  985 mcForwardEuropeanBSEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
  986  -> (Maybe Word) -- ^timeStepsPerYear
  987  -> (Bool) -- ^brownianBridge
  988  -> (Bool) -- ^antitheticVariate
  989  -> (Maybe Word) -- ^requiredSamples
  990  -> (Maybe Double) -- ^requiredTolerance
  991  -> (Maybe Word) -- ^maxSamples
  992  -> (Word) -- ^seed
  993  -> IO ((PricingEngine))
  994 mcForwardEuropeanBSEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  995   let {a1' = (fromIntegral . fromEnum) a1} in 
  996   let {a2' = (fromIntegral . fromEnum) a2} in 
  997   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
  998   let {a4' = fromMaybeInt a4} in 
  999   let {a5' = fromMaybeInt a5} in 
 1000   let {a6' = C2HSImp.fromBool a6} in 
 1001   let {a7' = C2HSImp.fromBool a7} in 
 1002   let {a8' = fromMaybeInt a8} in 
 1003   let {a9' = fromMaybeDouble a9} in 
 1004   let {a10' = fromMaybeInt a10} in 
 1005   let {a11' = fromIntegral a11} in 
 1006   preErrorCheck $ \a12' -> 
 1007   mcForwardEuropeanBSEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 1008   peekPricingEngine res >>= \res' ->
 1009   errorCheck  a12'>>
 1010   return (res')
 1011 
 1012 
 1013 
 1014 -- |analytic pricing engine for forward-starting European options under a Heston process
 1015 analyticHestonForwardEuropeanEngine :: (GenHestonProcess hp) -> (Word) -- ^integrationOrder
 1016  -> IO ((PricingEngine))
 1017 analyticHestonForwardEuropeanEngine a1 a2 =
 1018   withHestonProcess a1 $ \a1' -> 
 1019   let {a2' = fromIntegral a2} in 
 1020   preErrorCheck $ \a3' -> 
 1021   analyticHestonForwardEuropeanEngine'_ a1' a2' a3' >>= \res ->
 1022   peekPricingEngine res >>= \res' ->
 1023   errorCheck  a3'>>
 1024   return (res')
 1025 
 1026 
 1027 
 1028 -- |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
 1029 quantoEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 1030  -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 1031  -> (GenQuote q) -- ^correlation
 1032  -> IO ((PricingEngine))
 1033 quantoEuropeanEngine a1 a2 a3 a4 =
 1034   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1035   withYieldTermStructure a2 $ \a2' -> 
 1036   withBlackVolTermStructure a3 $ \a3' -> 
 1037   withQuote a4 $ \a4' -> 
 1038   preErrorCheck $ \a5' -> 
 1039   quantoEuropeanEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1040   peekPricingEngine res >>= \res' ->
 1041   errorCheck  a5'>>
 1042   return (res')
 1043 
 1044 
 1045 
 1046 -- |quanto-adjusts a forward-starting vanilla option; binds the @ForwardVanillaOption@\/@ForwardVanillaEngine\<AnalyticEuropeanEngine\>@ instantiation of @QuantoEngine\<Instr,Engine\>@
 1047 quantoForwardEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 1048  -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 1049  -> (GenQuote q) -- ^correlation
 1050  -> IO ((PricingEngine))
 1051 quantoForwardEuropeanEngine a1 a2 a3 a4 =
 1052   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1053   withYieldTermStructure a2 $ \a2' -> 
 1054   withBlackVolTermStructure a3 $ \a3' -> 
 1055   withQuote a4 $ \a4' -> 
 1056   preErrorCheck $ \a5' -> 
 1057   quantoForwardEuropeanEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1058   peekPricingEngine res >>= \res' ->
 1059   errorCheck  a5'>>
 1060   return (res')
 1061 
 1062 
 1063 
 1064 -- |quanto-adjusts a forward-starting performance (strike-resetting, percentage-payoff) vanilla option; binds the @ForwardVanillaOption@\/@ForwardPerformanceVanillaEngine\<AnalyticEuropeanEngine\>@ instantiation of @QuantoEngine\<Instr,Engine\>@
 1065 quantoForwardPerformanceEuropeanEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 1066  -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 1067  -> (GenQuote q) -- ^correlation
 1068  -> IO ((PricingEngine))
 1069 quantoForwardPerformanceEuropeanEngine a1 a2 a3 a4 =
 1070   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1071   withYieldTermStructure a2 $ \a2' -> 
 1072   withBlackVolTermStructure a3 $ \a3' -> 
 1073   withQuote a4 $ \a4' -> 
 1074   preErrorCheck $ \a5' -> 
 1075   quantoForwardPerformanceEuropeanEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1076   peekPricingEngine res >>= \res' ->
 1077   errorCheck  a5'>>
 1078   return (res')
 1079 
 1080 
 1081 
 1082 -- |quanto-adjusts a single-barrier option; binds the @BarrierOption@\/@AnalyticBarrierEngine@ instantiation of @QuantoEngine\<Instr,Engine\>@
 1083 quantoBarrierEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 1084  -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 1085  -> (GenQuote q) -- ^correlation
 1086  -> IO ((PricingEngine))
 1087 quantoBarrierEngine a1 a2 a3 a4 =
 1088   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1089   withYieldTermStructure a2 $ \a2' -> 
 1090   withBlackVolTermStructure a3 $ \a3' -> 
 1091   withQuote a4 $ \a4' -> 
 1092   preErrorCheck $ \a5' -> 
 1093   quantoBarrierEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1094   peekPricingEngine res >>= \res' ->
 1095   errorCheck  a5'>>
 1096   return (res')
 1097 
 1098 
 1099 
 1100 -- |quanto-adjusts a double-barrier option; binds the @DoubleBarrierOption@\/@AnalyticDoubleBarrierEngine@ instantiation of @QuantoEngine\<Instr,Engine\>@
 1101 quantoDoubleBarrierEngine :: (GeneralizedBlackScholesProcess) -> (GenYieldTermStructure y) -- ^foreignRiskFreeRate
 1102  -> (GenBlackVolTermStructure bv) -- ^exchangeRateVolatility
 1103  -> (GenQuote q) -- ^correlation
 1104  -> IO ((PricingEngine))
 1105 quantoDoubleBarrierEngine a1 a2 a3 a4 =
 1106   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1107   withYieldTermStructure a2 $ \a2' -> 
 1108   withBlackVolTermStructure a3 $ \a3' -> 
 1109   withQuote a4 $ \a4' -> 
 1110   preErrorCheck $ \a5' -> 
 1111   quantoDoubleBarrierEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1112   peekPricingEngine res >>= \res' ->
 1113   errorCheck  a5'>>
 1114   return (res')
 1115 
 1116 
 1117 
 1118 -- |Black-formula cap\/floor engine, taking an optionlet volatility structure
 1119 blackCapFloorEngine' :: (GenYieldTermStructure y) -> (GenOptionletVolatilityStructure ov) -> IO ((PricingEngine))
 1120 blackCapFloorEngine' a1 a2 =
 1121   withYieldTermStructure a1 $ \a1' -> 
 1122   withOptionletVolatilityStructure a2 $ \a2' -> 
 1123   preErrorCheck $ \a3' -> 
 1124   blackCapFloorEngine''_ a1' a2' a3' >>= \res ->
 1125   peekPricingEngine res >>= \res' ->
 1126   errorCheck  a3'>>
 1127   return (res')
 1128 
 1129 
 1130 
 1131 -- |Black-formula cap\/floor engine, taking a flat volatility quote
 1132 blackCapFloorEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> (Double) -- ^displacement
 1133  -> IO ((PricingEngine))
 1134 blackCapFloorEngine a1 a2 a3 a4 =
 1135   withYieldTermStructure a1 $ \a1' -> 
 1136   withQuote a2 $ \a2' -> 
 1137   withDayCounter a3 $ \a3' -> 
 1138   let {a4' = realToFrac a4} in 
 1139   preErrorCheck $ \a5' -> 
 1140   blackCapFloorEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1141   peekPricingEngine res >>= \res' ->
 1142   errorCheck  a5'>>
 1143   return (res')
 1144 
 1145 
 1146 
 1147 -- |shifted-lognormal Black-formula swaption engine, taking a flat volatility quote
 1148 blackSwaptionEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> (Double) -- ^displacement
 1149  -> (CashAnnuityModel) -- ^model
 1150  -> IO ((PricingEngine))
 1151 blackSwaptionEngine a1 a2 a3 a4 a5 =
 1152   withYieldTermStructure a1 $ \a1' -> 
 1153   withQuote a2 $ \a2' -> 
 1154   withDayCounter a3 $ \a3' -> 
 1155   let {a4' = realToFrac a4} in 
 1156   let {a5' = (fromIntegral . fromEnum) a5} in 
 1157   preErrorCheck $ \a6' -> 
 1158   blackSwaptionEngine'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 1159   peekPricingEngine res >>= \res' ->
 1160   errorCheck  a6'>>
 1161   return (res')
 1162 
 1163 
 1164 
 1165 -- |shifted-lognormal Black-formula swaption engine, taking a swaption volatility structure
 1166 blackSwaptionEngine' :: (GenYieldTermStructure y) -> (GenSwaptionVolatilityStructure sv) -> IO ((PricingEngine))
 1167 blackSwaptionEngine' a1 a2 =
 1168   withYieldTermStructure a1 $ \a1' -> 
 1169   withSwaptionVolatilityStructure a2 $ \a2' -> 
 1170   preErrorCheck $ \a3' -> 
 1171   blackSwaptionEngine''_ a1' a2' a3' >>= \res ->
 1172   peekPricingEngine res >>= \res' ->
 1173   errorCheck  a3'>>
 1174   return (res')
 1175 
 1176 
 1177 
 1178 -- |Bachelier (normal) cap\/floor engine, taking an optionlet volatility structure
 1179 bachelierCapFloorEngine' :: (GenYieldTermStructure y) -> (GenOptionletVolatilityStructure ov) -> IO ((PricingEngine))
 1180 bachelierCapFloorEngine' a1 a2 =
 1181   withYieldTermStructure a1 $ \a1' -> 
 1182   withOptionletVolatilityStructure a2 $ \a2' -> 
 1183   preErrorCheck $ \a3' -> 
 1184   bachelierCapFloorEngine''_ a1' a2' a3' >>= \res ->
 1185   peekPricingEngine res >>= \res' ->
 1186   errorCheck  a3'>>
 1187   return (res')
 1188 
 1189 
 1190 
 1191 -- |Bachelier (normal) cap\/floor engine, taking a flat volatility quote
 1192 bachelierCapFloorEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> IO ((PricingEngine))
 1193 bachelierCapFloorEngine a1 a2 a3 =
 1194   withYieldTermStructure a1 $ \a1' -> 
 1195   withQuote a2 $ \a2' -> 
 1196   withDayCounter a3 $ \a3' -> 
 1197   preErrorCheck $ \a4' -> 
 1198   bachelierCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
 1199   peekPricingEngine res >>= \res' ->
 1200   errorCheck  a4'>>
 1201   return (res')
 1202 
 1203 
 1204 
 1205 -- |Black-formula YoY inflation cap\/floor engine. The nominal discount curve and the index's
 1206 -- own linked 'QuantLib.TermStructure.Inflation.YoYInflationTermStructure' are separate --
 1207 -- @nominalTermStructure@ discounts cashflows, while the index forecasts them.
 1208 yoyInflationBlackCapFloorEngine :: (GenYoYInflationIndex yidx) -> (YoYOptionletVolatilitySurface) -- ^vol
 1209  -> (GenYieldTermStructure y) -- ^nominalTermStructure
 1210  -> IO ((PricingEngine))
 1211 yoyInflationBlackCapFloorEngine a1 a2 a3 =
 1212   withYoYInflationIndex a1 $ \a1' -> 
 1213   withGenVolatilityTermStructure a2 $ \a2' -> 
 1214   withYieldTermStructure a3 $ \a3' -> 
 1215   preErrorCheck $ \a4' -> 
 1216   yoyInflationBlackCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
 1217   peekPricingEngine res >>= \res' ->
 1218   errorCheck  a4'>>
 1219   return (res')
 1220 
 1221 
 1222 
 1223 -- |as 'yoyInflationBlackCapFloorEngine', but unit-displaced Black
 1224 yoyInflationUnitDisplacedBlackCapFloorEngine :: (GenYoYInflationIndex yidx) -> (YoYOptionletVolatilitySurface) -- ^vol
 1225  -> (GenYieldTermStructure y) -- ^nominalTermStructure
 1226  -> IO ((PricingEngine))
 1227 yoyInflationUnitDisplacedBlackCapFloorEngine a1 a2 a3 =
 1228   withYoYInflationIndex a1 $ \a1' -> 
 1229   withGenVolatilityTermStructure a2 $ \a2' -> 
 1230   withYieldTermStructure a3 $ \a3' -> 
 1231   preErrorCheck $ \a4' -> 
 1232   yoyInflationUnitDisplacedBlackCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
 1233   peekPricingEngine res >>= \res' ->
 1234   errorCheck  a4'>>
 1235   return (res')
 1236 
 1237 
 1238 
 1239 -- |as 'yoyInflationBlackCapFloorEngine', but Bachelier (normal model)
 1240 yoyInflationBachelierCapFloorEngine :: (GenYoYInflationIndex yidx) -> (YoYOptionletVolatilitySurface) -- ^vol
 1241  -> (GenYieldTermStructure y) -- ^nominalTermStructure
 1242  -> IO ((PricingEngine))
 1243 yoyInflationBachelierCapFloorEngine a1 a2 a3 =
 1244   withYoYInflationIndex a1 $ \a1' -> 
 1245   withGenVolatilityTermStructure a2 $ \a2' -> 
 1246   withYieldTermStructure a3 $ \a3' -> 
 1247   preErrorCheck $ \a4' -> 
 1248   yoyInflationBachelierCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
 1249   peekPricingEngine res >>= \res' ->
 1250   errorCheck  a4'>>
 1251   return (res')
 1252 
 1253 
 1254 
 1255 -- |The only 'QuantLib.Instrument.InflationCapFloor.CPICapFloor' pricing engine in QL 1.43 --
 1256 -- prices purely by interpolating a market price surface, no stochastic-vol model (see that
 1257 -- type's own haddock for the CPI\/YoY asymmetry).
 1258 interpolatingCPICapFloorEngine :: (CPICapFloorTermPriceSurface) -> IO ((PricingEngine))
 1259 interpolatingCPICapFloorEngine a1 =
 1260   withGenTermStructure a1 $ \a1' -> 
 1261   preErrorCheck $ \a2' -> 
 1262   interpolatingCPICapFloorEngine'_ a1' a2' >>= \res ->
 1263   peekPricingEngine res >>= \res' ->
 1264   errorCheck  a2'>>
 1265   return (res')
 1266 
 1267 
 1268 
 1269 -- |Bachelier (normal) swaption engine, taking a flat volatility quote
 1270 bachelierSwaptionEngine :: (GenYieldTermStructure y) -> (GenQuote q) -> (DayCounter) -> (CashAnnuityModel) -- ^model
 1271  -> IO ((PricingEngine))
 1272 bachelierSwaptionEngine a1 a2 a3 a4 =
 1273   withYieldTermStructure a1 $ \a1' -> 
 1274   withQuote a2 $ \a2' -> 
 1275   withDayCounter a3 $ \a3' -> 
 1276   let {a4' = (fromIntegral . fromEnum) a4} in 
 1277   preErrorCheck $ \a5' -> 
 1278   bachelierSwaptionEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1279   peekPricingEngine res >>= \res' ->
 1280   errorCheck  a5'>>
 1281   return (res')
 1282 
 1283 
 1284 
 1285 -- |Bachelier (normal) swaption engine, taking a swaption volatility structure
 1286 bachelierSwaptionEngine' :: (GenYieldTermStructure y) -> (GenSwaptionVolatilityStructure sv) -> IO ((PricingEngine))
 1287 bachelierSwaptionEngine' a1 a2 =
 1288   withYieldTermStructure a1 $ \a1' -> 
 1289   withSwaptionVolatilityStructure a2 $ \a2' -> 
 1290   preErrorCheck $ \a3' -> 
 1291   bachelierSwaptionEngine''_ a1' a2' a3' >>= \res ->
 1292   peekPricingEngine res >>= \res' ->
 1293   errorCheck  a3'>>
 1294   return (res')
 1295 
 1296 
 1297 
 1298 -- |analytic European option pricer including stochastic interest rates (Black-Scholes-Merton + Hull-White)
 1299 analyticBSMHullWhiteEngine :: (Double) -> (GeneralizedBlackScholesProcess) -> (HullWhite) -> IO ((PricingEngine))
 1300 analyticBSMHullWhiteEngine a1 a2 a3 =
 1301   let {a1' = realToFrac a1} in 
 1302   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
 1303   withHullWhite a3 $ \a3' -> 
 1304   preErrorCheck $ \a4' -> 
 1305   analyticBSMHullWhiteEngine'_ a1' a2' a3' a4' >>= \res ->
 1306   peekPricingEngine res >>= \res' ->
 1307   errorCheck  a4'>>
 1308   return (res')
 1309 
 1310 
 1311 
 1312 -- |the term structure is only needed when the short-rate model cannot provide one itself.
 1313 analyticCapFloorEngine :: (AffineModel) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1314 analyticCapFloorEngine a1 a2 =
 1315   withStandalone a1 $ \a1' -> 
 1316   withMaybeYieldTermStructure a2 $ \a2' -> 
 1317   preErrorCheck $ \a3' -> 
 1318   analyticCapFloorEngine'_ a1' a2' a3' >>= \res ->
 1319   peekPricingEngine res >>= \res' ->
 1320   errorCheck  a3'>>
 1321   return (res')
 1322 
 1323 
 1324 
 1325 -- |cap\/floor pricing engine for any one-factor Gaussian short-rate model, evaluated by
 1326 -- integration over the model's state variable. As 'gaussian1dSwaptionEngine', without
 1327 -- 'Probabilities'.
 1328 gaussian1dCapFloorEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 1329  -> (Double) -- ^stddevs
 1330  -> (Bool) -- ^extrapolatePayoff
 1331  -> (Bool) -- ^flatPayoffExtrapolation
 1332  -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 1333  -> IO ((PricingEngine))
 1334 gaussian1dCapFloorEngine a1 a2 a3 a4 a5 a6 =
 1335   withStandalone a1 $ \a1' -> 
 1336   let {a2' = fromIntegral a2} in 
 1337   let {a3' = realToFrac a3} in 
 1338   let {a4' = C2HSImp.fromBool a4} in 
 1339   let {a5' = C2HSImp.fromBool a5} in 
 1340   withMaybeYieldTermStructure a6 $ \a6' -> 
 1341   preErrorCheck $ \a7' -> 
 1342   gaussian1dCapFloorEngine'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 1343   peekPricingEngine res >>= \res' ->
 1344   errorCheck  a7'>>
 1345   return (res')
 1346 
 1347 
 1348 
 1349 -- |analytic pricing engine for vanilla options under a GJR-GARCH process
 1350 analyticGJRGARCHEngine :: (GJRGARCHModel) -> IO ((PricingEngine))
 1351 analyticGJRGARCHEngine a1 =
 1352   withGenCalibratedModel a1 $ \a1' -> 
 1353   preErrorCheck $ \a2' -> 
 1354   analyticGJRGARCHEngine'_ a1' a2' >>= \res ->
 1355   peekPricingEngine res >>= \res' ->
 1356   errorCheck  a2'>>
 1357   return (res')
 1358 
 1359 
 1360 
 1361 -- |semi-analytic Heston-model pricing engine, integrating with a fixed relative tolerance and evaluation cap
 1362 analyticHestonEngine :: (GenHestonModel hm) -> (Double) -- ^relTolerance
 1363  -> (Word) -- ^maxEvaluations
 1364  -> IO ((PricingEngine))
 1365 analyticHestonEngine a1 a2 a3 =
 1366   withHestonModel a1 $ \a1' -> 
 1367   let {a2' = realToFrac a2} in 
 1368   let {a3' = fromIntegral a3} in 
 1369   preErrorCheck $ \a4' -> 
 1370   analyticHestonEngine'_ a1' a2' a3' a4' >>= \res ->
 1371   peekPricingEngine res >>= \res' ->
 1372   errorCheck  a4'>>
 1373   return (res')
 1374 
 1375 
 1376 
 1377 -- |semi-analytic pricing engine combining a Heston equity model with a Hull-White short-rate model
 1378 analyticHestonHullWhiteEngine :: (GenHestonModel hm) -> (HullWhite) -> (Word) -- ^integrationOrder
 1379  -> IO ((PricingEngine))
 1380 analyticHestonHullWhiteEngine a1 a2 a3 =
 1381   withHestonModel a1 $ \a1' -> 
 1382   withHullWhite a2 $ \a2' -> 
 1383   let {a3' = fromIntegral a3} in 
 1384   preErrorCheck $ \a4' -> 
 1385   analyticHestonHullWhiteEngine'_ a1' a2' a3' a4' >>= \res ->
 1386   peekPricingEngine res >>= \res' ->
 1387   errorCheck  a4'>>
 1388   return (res')
 1389 
 1390 
 1391 
 1392 -- |semi-analytic pricing engine for the Bates (Heston plus jumps) model, integrating with a fixed order
 1393 batesEngine :: (GenBatesModel bm) -> (Word) -- ^integrationOrder
 1394  -> IO ((PricingEngine))
 1395 batesEngine a1 a2 =
 1396   withBatesModel a1 $ \a1' -> 
 1397   let {a2' = fromIntegral a2} in 
 1398   preErrorCheck $ \a3' -> 
 1399   batesEngine'_ a1' a2' a3' >>= \res ->
 1400   peekPricingEngine res >>= \res' ->
 1401   errorCheck  a3'>>
 1402   return (res')
 1403 
 1404 
 1405 
 1406 -- |FFT-based pricing engine for vanilla options under a Black-Scholes process
 1407 fftVanillaEngine :: (GeneralizedBlackScholesProcess) -> (Double) -- ^logStrikeSpacing
 1408  -> IO ((PricingEngine))
 1409 fftVanillaEngine a1 a2 =
 1410   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1411   let {a2' = realToFrac a2} in 
 1412   preErrorCheck $ \a3' -> 
 1413   fftVanillaEngine'_ a1' a2' a3' >>= \res ->
 1414   peekPricingEngine res >>= \res' ->
 1415   errorCheck  a3'>>
 1416   return (res')
 1417 
 1418 
 1419 
 1420 -- |swaption pricing engine for the G2 two-factor short-rate model, priced via the Black formula
 1421 g2SwaptionEngine :: (G2) -> (Double) -- ^range
 1422  -> (Word) -- ^intervals
 1423  -> IO ((PricingEngine))
 1424 g2SwaptionEngine a1 a2 a3 =
 1425   withG2 a1 $ \a1' -> 
 1426   let {a2' = realToFrac a2} in 
 1427   let {a3' = fromIntegral a3} in 
 1428   preErrorCheck $ \a4' -> 
 1429   g2SwaptionEngine'_ a1' a2' a3' a4' >>= \res ->
 1430   peekPricingEngine res >>= \res' ->
 1431   errorCheck  a4'>>
 1432   return (res')
 1433 
 1434 
 1435 
 1436 -- |jump-diffusion pricing engine for vanilla options, taking a Merton76 process
 1437 jumpDiffusionEngine :: (Merton76Process) -> (Double) -- ^relativeAccuracy
 1438  -> (Word) -- ^maxIterations
 1439  -> IO ((PricingEngine))
 1440 jumpDiffusionEngine a1 a2 a3 =
 1441   withGenStochasticProcess1D a1 $ \a1' -> 
 1442   let {a2' = realToFrac a2} in 
 1443   let {a3' = fromIntegral a3} in 
 1444   preErrorCheck $ \a4' -> 
 1445   jumpDiffusionEngine'_ a1' a2' a3' a4' >>= \res ->
 1446   peekPricingEngine res >>= \res' ->
 1447   errorCheck  a4'>>
 1448   return (res')
 1449 
 1450 
 1451 
 1452 -- |numerical-lattice pricing engine for caps\/floors under a short-rate model
 1453 treeCapFloorEngine :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 1454  -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1455 treeCapFloorEngine a1 a2 a3 =
 1456   withShortRateModel a1 $ \a1' -> 
 1457   let {a2' = fromIntegral a2} in 
 1458   withMaybeYieldTermStructure a3 $ \a3' -> 
 1459   preErrorCheck $ \a4' -> 
 1460   treeCapFloorEngine'_ a1' a2' a3' a4' >>= \res ->
 1461   peekPricingEngine res >>= \res' ->
 1462   errorCheck  a4'>>
 1463   return (res')
 1464 
 1465 
 1466 
 1467 -- |numerical-lattice pricing engine for swaptions under a short-rate model
 1468 treeSwaptionEngine :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 1469  -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1470 treeSwaptionEngine a1 a2 a3 =
 1471   withShortRateModel a1 $ \a1' -> 
 1472   let {a2' = fromIntegral a2} in 
 1473   withMaybeYieldTermStructure a3 $ \a3' -> 
 1474   preErrorCheck $ \a4' -> 
 1475   treeSwaptionEngine'_ a1' a2' a3' a4' >>= \res ->
 1476   peekPricingEngine res >>= \res' ->
 1477   errorCheck  a4'>>
 1478   return (res')
 1479 
 1480 
 1481 
 1482 -- |numerical-lattice pricing engine for plain vanilla swaps under a short-rate model
 1483 treeVanillaSwapEngine :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 1484  -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1485 treeVanillaSwapEngine a1 a2 a3 =
 1486   withShortRateModel a1 $ \a1' -> 
 1487   let {a2' = fromIntegral a2} in 
 1488   withMaybeYieldTermStructure a3 $ \a3' -> 
 1489   preErrorCheck $ \a4' -> 
 1490   treeVanillaSwapEngine'_ a1' a2' a3' a4' >>= \res ->
 1491   peekPricingEngine res >>= \res' ->
 1492   errorCheck  a4'>>
 1493   return (res')
 1494 
 1495 
 1496 
 1497 -- |pricing engine for European vanilla options using the Variance Gamma model, integrated numerically
 1498 varianceGammaEngine :: (VarianceGammaProcess) -> (Double) -- ^absoluteError
 1499  -> IO ((PricingEngine))
 1500 varianceGammaEngine a1 a2 =
 1501   withGenStochasticProcess1D a1 $ \a1' -> 
 1502   let {a2' = realToFrac a2} in 
 1503   preErrorCheck $ \a3' -> 
 1504   varianceGammaEngine'_ a1' a2' a3' >>= \res ->
 1505   peekPricingEngine res >>= \res' ->
 1506   errorCheck  a3'>>
 1507   return (res')
 1508 
 1509 
 1510 
 1511 -- |semi-analytic Heston-model pricing engine, integrating with a fixed quadrature order
 1512 analyticHestonEngine' :: (GenHestonModel hm) -> (Word) -- ^integrationOrder
 1513  -> IO ((PricingEngine))
 1514 analyticHestonEngine' a1 a2 =
 1515   withHestonModel a1 $ \a1' -> 
 1516   let {a2' = fromIntegral a2} in 
 1517   preErrorCheck $ \a3' -> 
 1518   analyticHestonEngine''_ a1' a2' a3' >>= \res ->
 1519   peekPricingEngine res >>= \res' ->
 1520   errorCheck  a3'>>
 1521   return (res')
 1522 
 1523 
 1524 
 1525 -- |semi-analytic Heston/Hull-White engine, integrating with a fixed relative tolerance and evaluation cap
 1526 analyticHestonHullWhiteEngine' :: (GenHestonModel hm) -> (HullWhite) -> (Double) -- ^relTolerance
 1527  -> (Word) -- ^maxEvaluations
 1528  -> IO ((PricingEngine))
 1529 analyticHestonHullWhiteEngine' a1 a2 a3 a4 =
 1530   withHestonModel a1 $ \a1' -> 
 1531   withHullWhite a2 $ \a2' -> 
 1532   let {a3' = realToFrac a3} in 
 1533   let {a4' = fromIntegral a4} in 
 1534   preErrorCheck $ \a5' -> 
 1535   analyticHestonHullWhiteEngine''_ a1' a2' a3' a4' a5' >>= \res ->
 1536   peekPricingEngine res >>= \res' ->
 1537   errorCheck  a5'>>
 1538   return (res')
 1539 
 1540 
 1541 
 1542 -- |semi-analytic Bates-model pricing engine, integrating with a fixed relative tolerance and evaluation cap
 1543 batesEngine' :: (GenBatesModel bm) -> (Double) -- ^relTolerance
 1544  -> (Word) -- ^maxEvaluations
 1545  -> IO ((PricingEngine))
 1546 batesEngine' a1 a2 a3 =
 1547   withBatesModel a1 $ \a1' -> 
 1548   let {a2' = realToFrac a2} in 
 1549   let {a3' = fromIntegral a3} in 
 1550   preErrorCheck $ \a4' -> 
 1551   batesEngine''_ a1' a2' a3' a4' >>= \res ->
 1552   peekPricingEngine res >>= \res' ->
 1553   errorCheck  a4'>>
 1554   return (res')
 1555 
 1556 
 1557 
 1558 -- |Barone-Adesi and Whaley (1987) quadratic-approximation engine for American options
 1559 baroneAdesiWhaleyApproximationEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
 1560 baroneAdesiWhaleyApproximationEngine a1 =
 1561   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1562   preErrorCheck $ \a2' -> 
 1563   baroneAdesiWhaleyApproximationEngine'_ a1' a2' >>= \res ->
 1564   peekPricingEngine res >>= \res' ->
 1565   errorCheck  a2'>>
 1566   return (res')
 1567 
 1568 
 1569 
 1570 -- |semi-analytic engine for the Bates model with deterministic jumps, integrating with a fixed relative tolerance and evaluation cap
 1571 batesDetJumpEngine' :: (BatesDetJumpModel) -> (Double) -- ^relTolerance
 1572  -> (Word) -- ^maxEvaluations
 1573  -> IO ((PricingEngine))
 1574 batesDetJumpEngine' a1 a2 a3 =
 1575   withBatesDetJumpModel a1 $ \a1' -> 
 1576   let {a2' = realToFrac a2} in 
 1577   let {a3' = fromIntegral a3} in 
 1578   preErrorCheck $ \a4' -> 
 1579   batesDetJumpEngine''_ a1' a2' a3' a4' >>= \res ->
 1580   peekPricingEngine res >>= \res' ->
 1581   errorCheck  a4'>>
 1582   return (res')
 1583 
 1584 
 1585 
 1586 -- |semi-analytic engine for the Bates model with deterministic jumps, integrating with a fixed quadrature order
 1587 batesDetJumpEngine :: (BatesDetJumpModel) -> (Word) -- ^integrationOrder
 1588  -> IO ((PricingEngine))
 1589 batesDetJumpEngine a1 a2 =
 1590   withBatesDetJumpModel a1 $ \a1' -> 
 1591   let {a2' = fromIntegral a2} in 
 1592   preErrorCheck $ \a3' -> 
 1593   batesDetJumpEngine'_ a1' a2' a3' >>= \res ->
 1594   peekPricingEngine res >>= \res' ->
 1595   errorCheck  a3'>>
 1596   return (res')
 1597 
 1598 
 1599 
 1600 -- |semi-analytic engine for the double-exponential-jump Bates model with deterministic jumps, integrating with a fixed relative tolerance and evaluation cap
 1601 batesDoubleExpDetJumpEngine' :: (BatesDoubleExpDetJumpModel) -> (Double) -- ^relTolerance
 1602  -> (Word) -- ^maxEvaluations
 1603  -> IO ((PricingEngine))
 1604 batesDoubleExpDetJumpEngine' a1 a2 a3 =
 1605   withBatesDoubleExpDetJumpModel a1 $ \a1' -> 
 1606   let {a2' = realToFrac a2} in 
 1607   let {a3' = fromIntegral a3} in 
 1608   preErrorCheck $ \a4' -> 
 1609   batesDoubleExpDetJumpEngine''_ a1' a2' a3' a4' >>= \res ->
 1610   peekPricingEngine res >>= \res' ->
 1611   errorCheck  a4'>>
 1612   return (res')
 1613 
 1614 
 1615 
 1616 -- |semi-analytic engine for the double-exponential-jump Bates model with deterministic jumps, integrating with a fixed quadrature order
 1617 batesDoubleExpDetJumpEngine :: (BatesDoubleExpDetJumpModel) -> (Word) -- ^integrationOrder
 1618  -> IO ((PricingEngine))
 1619 batesDoubleExpDetJumpEngine a1 a2 =
 1620   withBatesDoubleExpDetJumpModel a1 $ \a1' -> 
 1621   let {a2' = fromIntegral a2} in 
 1622   preErrorCheck $ \a3' -> 
 1623   batesDoubleExpDetJumpEngine'_ a1' a2' a3' >>= \res ->
 1624   peekPricingEngine res >>= \res' ->
 1625   errorCheck  a3'>>
 1626   return (res')
 1627 
 1628 
 1629 
 1630 -- |semi-analytic engine for the double-exponential-jump Bates model, integrating with a fixed relative tolerance and evaluation cap
 1631 batesDoubleExpEngine' :: (GenBatesDoubleExpModel bdem) -> (Double) -- ^relTolerance
 1632  -> (Word) -- ^maxEvaluations
 1633  -> IO ((PricingEngine))
 1634 batesDoubleExpEngine' a1 a2 a3 =
 1635   withBatesDoubleExpModel a1 $ \a1' -> 
 1636   let {a2' = realToFrac a2} in 
 1637   let {a3' = fromIntegral a3} in 
 1638   preErrorCheck $ \a4' -> 
 1639   batesDoubleExpEngine''_ a1' a2' a3' a4' >>= \res ->
 1640   peekPricingEngine res >>= \res' ->
 1641   errorCheck  a4'>>
 1642   return (res')
 1643 
 1644 
 1645 
 1646 -- |semi-analytic engine for the double-exponential-jump Bates model, integrating with a fixed quadrature order
 1647 batesDoubleExpEngine :: (GenBatesDoubleExpModel bdem) -> (Word) -- ^integrationOrder
 1648  -> IO ((PricingEngine))
 1649 batesDoubleExpEngine a1 a2 =
 1650   withBatesDoubleExpModel a1 $ \a1' -> 
 1651   let {a2' = fromIntegral a2} in 
 1652   preErrorCheck $ \a3' -> 
 1653   batesDoubleExpEngine'_ a1' a2' a3' >>= \res ->
 1654   peekPricingEngine res >>= \res' ->
 1655   errorCheck  a3'>>
 1656   return (res')
 1657 
 1658 
 1659 
 1660 -- |Bjerksund and Stensland (1993) approximation engine for American options
 1661 bjerksundStenslandApproximationEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
 1662 bjerksundStenslandApproximationEngine a1 =
 1663   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1664   preErrorCheck $ \a2' -> 
 1665   bjerksundStenslandApproximationEngine'_ a1' a2' >>= \res ->
 1666   peekPricingEngine res >>= \res' ->
 1667   errorCheck  a2'>>
 1668   return (res')
 1669 
 1670 
 1671 
 1672 -- |CDS pricing engine that integrates the default-leg payoff over the CDS's step-wise schedule
 1673 integralCdsEngine :: ((Word,TimeUnit)) -- ^integrationStep
 1674  -> (DefaultProbabilityTermStructure) -> (Double) -- ^recoveryRate
 1675  -> (GenYieldTermStructure y) -- ^discountCurve
 1676  -> (Maybe Bool) -- ^includeSettlementDateFlows
 1677  -> IO ((PricingEngine))
 1678 integralCdsEngine a1 a2 a3 a4 a5 =
 1679   let {(a1'1, a1'2) = fromEnumQuantity a1} in 
 1680   withGenTermStructure a2 $ \a2' -> 
 1681   let {a3' = realToFrac a3} in 
 1682   withYieldTermStructure a4 $ \a4' -> 
 1683   let {a5' = fromMaybeBool a5} in 
 1684   preErrorCheck $ \a6' -> 
 1685   integralCdsEngine'_ a1'1  a1'2 a2' a3' a4' a5' a6' >>= \res ->
 1686   peekPricingEngine res >>= \res' ->
 1687   errorCheck  a6'>>
 1688   return (res')
 1689 
 1690 
 1691 
 1692 -- |pricing engine for European vanilla options using an integral approach
 1693 integralEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
 1694 integralEngine a1 =
 1695   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1696   preErrorCheck $ \a2' -> 
 1697   integralEngine'_ a1' a2' >>= \res ->
 1698   peekPricingEngine res >>= \res' ->
 1699   errorCheck  a2'>>
 1700   return (res')
 1701 
 1702 
 1703 
 1704 -- |the term structure is only needed when the short-rate model cannot provide one itself.
 1705 jamshidianSwaptionEngine :: (GenOneFactorAffineModel om) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1706 jamshidianSwaptionEngine a1 a2 =
 1707   withOneFactorAffineModel a1 $ \a1' -> 
 1708   withMaybeYieldTermStructure a2 $ \a2' -> 
 1709   preErrorCheck $ \a3' -> 
 1710   jamshidianSwaptionEngine'_ a1' a2' a3' >>= \res ->
 1711   peekPricingEngine res >>= \res' ->
 1712   errorCheck  a3'>>
 1713   return (res')
 1714 
 1715 
 1716 
 1717 -- |swaption pricing engine for any one-factor Gaussian short-rate model, evaluated by integration over the model's state variable
 1718 gaussian1dSwaptionEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 1719  -> (Double) -- ^stddevs
 1720  -> (Bool) -- ^extrapolatePayoff
 1721  -> (Bool) -- ^flatPayoffExtrapolation
 1722  -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 1723  -> (Probabilities) -- ^probabilities
 1724  -> IO ((PricingEngine))
 1725 gaussian1dSwaptionEngine a1 a2 a3 a4 a5 a6 a7 =
 1726   withStandalone a1 $ \a1' -> 
 1727   let {a2' = fromIntegral a2} in 
 1728   let {a3' = realToFrac a3} in 
 1729   let {a4' = C2HSImp.fromBool a4} in 
 1730   let {a5' = C2HSImp.fromBool a5} in 
 1731   withMaybeYieldTermStructure a6 $ \a6' -> 
 1732   let {a7' = (fromIntegral . fromEnum) a7} in 
 1733   preErrorCheck $ \a8' -> 
 1734   gaussian1dSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 1735   peekPricingEngine res >>= \res' ->
 1736   errorCheck  a8'>>
 1737   return (res')
 1738 
 1739 
 1740 
 1741 -- |As 'gaussian1dSwaptionEngine', for a 'QuantLib.Instrument.Swap.NonstandardSwaption'. Adds
 1742 -- an optional OAS ('oas', continuously compounded w.r.t. the discount curve's day counter) on
 1743 -- top of the shared parameters.
 1744 gaussian1dNonstandardSwaptionEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 1745  -> (Double) -- ^stddevs
 1746  -> (Bool) -- ^extrapolatePayoff
 1747  -> (Bool) -- ^flatPayoffExtrapolation
 1748  -> (Maybe (GenQuote q)) -- ^oas
 1749  -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 1750  -> (Probabilities) -- ^probabilities
 1751  -> IO ((PricingEngine))
 1752 gaussian1dNonstandardSwaptionEngine a1 a2 a3 a4 a5 a6 a7 a8 =
 1753   withStandalone a1 $ \a1' -> 
 1754   let {a2' = fromIntegral a2} in 
 1755   let {a3' = realToFrac a3} in 
 1756   let {a4' = C2HSImp.fromBool a4} in 
 1757   let {a5' = C2HSImp.fromBool a5} in 
 1758   withMaybeQuote a6 $ \a6' -> 
 1759   withMaybeYieldTermStructure a7 $ \a7' -> 
 1760   let {a8' = (fromIntegral . fromEnum) a8} in 
 1761   preErrorCheck $ \a9' -> 
 1762   gaussian1dNonstandardSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 1763   peekPricingEngine res >>= \res' ->
 1764   errorCheck  a9'>>
 1765   return (res')
 1766 
 1767 
 1768 
 1769 -- |As 'gaussian1dNonstandardSwaptionEngine', for a
 1770 -- 'QuantLib.Instrument.Swap.FloatFloatSwaption'. Adds 'includeTodaysExercise' -- whether a
 1771 -- fixing due exactly \"today\" counts as part of the exercise-into leg.
 1772 gaussian1dFloatFloatSwaptionEngine :: (Gaussian1dModel) -> (Int) -- ^integrationPoints
 1773  -> (Double) -- ^stddevs
 1774  -> (Bool) -- ^extrapolatePayoff
 1775  -> (Bool) -- ^flatPayoffExtrapolation
 1776  -> (Maybe (GenQuote q)) -- ^oas
 1777  -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 1778  -> (Bool) -- ^includeTodaysExercise
 1779  -> (Probabilities) -- ^probabilities
 1780  -> IO ((PricingEngine))
 1781 gaussian1dFloatFloatSwaptionEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 1782   withStandalone a1 $ \a1' -> 
 1783   let {a2' = fromIntegral a2} in 
 1784   let {a3' = realToFrac a3} in 
 1785   let {a4' = C2HSImp.fromBool a4} in 
 1786   let {a5' = C2HSImp.fromBool a5} in 
 1787   withMaybeQuote a6 $ \a6' -> 
 1788   withMaybeYieldTermStructure a7 $ \a7' -> 
 1789   let {a8' = C2HSImp.fromBool a8} in 
 1790   let {a9' = (fromIntegral . fromEnum) a9} in 
 1791   preErrorCheck $ \a10' -> 
 1792   gaussian1dFloatFloatSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 1793   peekPricingEngine res >>= \res' ->
 1794   errorCheck  a10'>>
 1795   return (res')
 1796 
 1797 
 1798 
 1799 -- |swaption pricing engine using Jamshidian's decomposition, for any one-factor Gaussian
 1800 -- short-rate model.
 1801 gaussian1dJamshidianSwaptionEngine :: (Gaussian1dModel) -> IO ((PricingEngine))
 1802 gaussian1dJamshidianSwaptionEngine a1 =
 1803   withStandalone a1 $ \a1' -> 
 1804   preErrorCheck $ \a2' -> 
 1805   gaussian1dJamshidianSwaptionEngine'_ a1' a2' >>= \res ->
 1806   peekPricingEngine res >>= \res' ->
 1807   errorCheck  a2'>>
 1808   return (res')
 1809 
 1810 
 1811 
 1812 -- |Ju (1999) quadratic-approximation engine for American options
 1813 juQuadraticApproximationEngine :: (GeneralizedBlackScholesProcess) -> IO ((PricingEngine))
 1814 juQuadraticApproximationEngine a1 =
 1815   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1816   preErrorCheck $ \a2' -> 
 1817   juQuadraticApproximationEngine'_ a1' a2' >>= \res ->
 1818   peekPricingEngine res >>= \res' ->
 1819   errorCheck  a2'>>
 1820   return (res')
 1821 
 1822 
 1823 
 1824 -- |pricing engine for a spread option on two futures/assets
 1825 kirkEngine :: (BlackProcess) -> (BlackProcess) -> (Double) -- ^correlation
 1826  -> IO ((PricingEngine))
 1827 kirkEngine a1 a2 a3 =
 1828   withBlackProcess a1 $ \a1' -> 
 1829   withBlackProcess a2 $ \a2' -> 
 1830   let {a3' = realToFrac a3} in 
 1831   preErrorCheck $ \a4' -> 
 1832   kirkEngine'_ a1' a2' a3' a4' >>= \res ->
 1833   peekPricingEngine res >>= \res' ->
 1834   errorCheck  a4'>>
 1835   return (res')
 1836 
 1837 
 1838 
 1839 -- |CDS pricing engine using the mid-point approximation, evaluating the default leg at the mid-point of each accrual period
 1840 midPointCdsEngine :: (DefaultProbabilityTermStructure) -> (Double) -- ^recoveryRate
 1841  -> (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
 1842  -> IO ((PricingEngine))
 1843 midPointCdsEngine a1 a2 a3 a4 =
 1844   withGenTermStructure a1 $ \a1' -> 
 1845   let {a2' = realToFrac a2} in 
 1846   withYieldTermStructure a3 $ \a3' -> 
 1847   let {a4' = fromMaybeBool a4} in 
 1848   preErrorCheck $ \a5' -> 
 1849   midPointCdsEngine'_ a1' a2' a3' a4' a5' >>= \res ->
 1850   peekPricingEngine res >>= \res' ->
 1851   errorCheck  a5'>>
 1852   return (res')
 1853 
 1854 
 1855 
 1856 -- |CDS pricing engine implementing the ISDA standard model
 1857 isdaCdsEngine :: (DefaultProbabilityTermStructure) -> (Double) -- ^recoveryRate
 1858  -> (GenYieldTermStructure y) -> (Maybe Bool) -- ^includeSettlementDateFlows
 1859  -> (NumericalFix) -- ^numericalFix
 1860  -> (AccrualBias) -- ^accrualBias
 1861  -> (ForwardsInCouponPeriod) -- ^forwardsInCouponPeriod
 1862  -> IO ((PricingEngine))
 1863 isdaCdsEngine a1 a2 a3 a4 a5 a6 a7 =
 1864   withGenTermStructure a1 $ \a1' -> 
 1865   let {a2' = realToFrac a2} in 
 1866   withYieldTermStructure a3 $ \a3' -> 
 1867   let {a4' = fromMaybeBool a4} in 
 1868   let {a5' = (fromIntegral . fromEnum) a5} in 
 1869   let {a6' = (fromIntegral . fromEnum) a6} in 
 1870   let {a7' = (fromIntegral . fromEnum) a7} in 
 1871   preErrorCheck $ \a8' -> 
 1872   isdaCdsEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 1873   peekPricingEngine res >>= \res' ->
 1874   errorCheck  a8'>>
 1875   return (res')
 1876 
 1877 
 1878 
 1879 -- |variance-swap pricing engine using a replicating portfolio of vanilla options at the given strikes
 1880 replicatingVarianceSwapEngine :: (GeneralizedBlackScholesProcess) -> (Double) -- ^dk
 1881  -> ([Double]) -- ^callStrikes
 1882  -> ([Double]) -- ^putStrikes
 1883  -> IO ((PricingEngine))
 1884 replicatingVarianceSwapEngine a1 a2 a3 a4 =
 1885   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1886   let {a2' = realToFrac a2} in 
 1887   withDoubleArray a3 $ \(a3'1, a3'2) -> 
 1888   withDoubleArray a4 $ \(a4'1, a4'2) -> 
 1889   preErrorCheck $ \a5' -> 
 1890   replicatingVarianceSwapEngine'_ a1' a2' a3'1  a3'2 a4'1  a4'2 a5' >>= \res ->
 1891   peekPricingEngine res >>= \res' ->
 1892   errorCheck  a5'>>
 1893   return (res')
 1894 
 1895 
 1896 
 1897 -- |pricing engine for 2D European basket options (Stulz formula)
 1898 stulzEngine :: (GeneralizedBlackScholesProcess) -> (GeneralizedBlackScholesProcess) -> (Double) -- ^correlation
 1899  -> IO ((PricingEngine))
 1900 stulzEngine a1 a2 a3 =
 1901   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 1902   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
 1903   let {a3' = realToFrac a3} in 
 1904   preErrorCheck $ \a4' -> 
 1905   stulzEngine'_ a1' a2' a3' a4' >>= \res ->
 1906   peekPricingEngine res >>= \res' ->
 1907   errorCheck  a4'>>
 1908   return (res')
 1909 
 1910 
 1911 
 1912 -- |Libor forward model swaption engine, priced via the Black formula
 1913 lfmSwaptionEngine :: (LiborForwardModel) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
 1914 lfmSwaptionEngine a1 a2 =
 1915   withGenCalibratedModel a1 $ \a1' -> 
 1916   withYieldTermStructure a2 $ \a2' -> 
 1917   preErrorCheck $ \a3' -> 
 1918   lfmSwaptionEngine'_ a1' a2' a3' >>= \res ->
 1919   peekPricingEngine res >>= \res' ->
 1920   errorCheck  a3'>>
 1921   return (res')
 1922 
 1923 
 1924 
 1925 -- |numerical-lattice pricing engine for caps\/floors under a short-rate model, on an explicit time grid
 1926 treeCapFloorEngine' :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1927 treeCapFloorEngine' a1 a2 a3 =
 1928   withShortRateModel a1 $ \a1' -> 
 1929   withTimeGrid a2 $ \a2' -> 
 1930   withMaybeYieldTermStructure a3 $ \a3' -> 
 1931   preErrorCheck $ \a4' -> 
 1932   treeCapFloorEngine''_ a1' a2' a3' a4' >>= \res ->
 1933   peekPricingEngine res >>= \res' ->
 1934   errorCheck  a4'>>
 1935   return (res')
 1936 
 1937 
 1938 
 1939 -- |numerical-lattice pricing engine for swaptions under a short-rate model, on an explicit time grid
 1940 treeSwaptionEngine' :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1941 treeSwaptionEngine' a1 a2 a3 =
 1942   withShortRateModel a1 $ \a1' -> 
 1943   withTimeGrid a2 $ \a2' -> 
 1944   withMaybeYieldTermStructure a3 $ \a3' -> 
 1945   preErrorCheck $ \a4' -> 
 1946   treeSwaptionEngine''_ a1' a2' a3' a4' >>= \res ->
 1947   peekPricingEngine res >>= \res' ->
 1948   errorCheck  a4'>>
 1949   return (res')
 1950 
 1951 
 1952 
 1953 -- |numerical-lattice pricing engine for plain vanilla swaps under a short-rate model, on an explicit time grid
 1954 treeVanillaSwapEngine' :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 1955 treeVanillaSwapEngine' a1 a2 a3 =
 1956   withShortRateModel a1 $ \a1' -> 
 1957   withTimeGrid a2 $ \a2' -> 
 1958   withMaybeYieldTermStructure a3 $ \a3' -> 
 1959   preErrorCheck $ \a4' -> 
 1960   treeVanillaSwapEngine''_ a1' a2' a3' a4' >>= \res ->
 1961   peekPricingEngine res >>= \res' ->
 1962   errorCheck  a4'>>
 1963   return (res')
 1964 
 1965 
 1966 
 1967 
 1968 
 1969 
 1970 
 1971 
 1972 -- |Snapshots @rTS@/@fTS@/@fxVolTS@ at construction time (their underlying @shared_ptr@s are copied
 1973 -- out of their handles): a later relink of a 'RelinkableYieldTermStructure' or
 1974 -- 'RelinkableBlackVolTermStructure' passed in here will /not/ be reflected in this 'FdmQuantoHelper'.
 1975 fdmQuantoHelper :: (GenYieldTermStructure y1) -- ^rTS
 1976  -> (GenYieldTermStructure y2) -- ^fTS
 1977  -> (GenBlackVolTermStructure bv) -- ^fxVolTS
 1978  -> (Double) -- ^equityFxCorrelation
 1979  -> (Double) -- ^exchRateATMlevel
 1980  -> IO ((FdmQuantoHelper))
 1981 fdmQuantoHelper a1 a2 a3 a4 a5 =
 1982   withYieldTermStructure a1 $ \a1' -> 
 1983   withYieldTermStructure a2 $ \a2' -> 
 1984   withBlackVolTermStructure a3 $ \a3' -> 
 1985   let {a4' = realToFrac a4} in 
 1986   let {a5' = realToFrac a5} in 
 1987   preErrorCheck $ \a6' -> 
 1988   fdmQuantoHelper'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 1989   peekFdmQuantoHelper res >>= \res' ->
 1990   errorCheck  a6'>>
 1991   return (res')
 1992 
 1993 
 1994 
 1995 -- |quanto drift adjustment @domesticRate - foreignRate + equityFxCorrelation*equityVol*fxVol@ over @[t1,t2]@
 1996 fdmQuantoHelperQuantoAdjustment :: (FdmQuantoHelper) -> (Double) -- ^equityVol
 1997  -> (Double) -- ^t1
 1998  -> (Double) -- ^t2
 1999  -> IO ((Double))
 2000 fdmQuantoHelperQuantoAdjustment a1 a2 a3 a4 =
 2001   withFdmQuantoHelper a1 $ \a1' -> 
 2002   let {a2' = realToFrac a2} in 
 2003   let {a3' = realToFrac a3} in 
 2004   let {a4' = realToFrac a4} in 
 2005   preErrorCheck $ \a5' -> 
 2006   fdmQuantoHelperQuantoAdjustment'_ a1' a2' a3' a4' a5' >>= \res ->
 2007   let {res' = realToFrac res} in
 2008   errorCheck  a5'>>
 2009   return (res')
 2010 
 2011 
 2012 
 2013 
 2014 
 2015 
 2016 -- |finite-differences swaption pricing engine for the G2 two-factor short-rate model
 2017 fdG2SwaptionEngine :: (G2) -> (Word) -- ^tGrid
 2018  -> (Word) -- ^xGrid
 2019  -> (Word) -- ^yGrid
 2020  -> (Word) -- ^dampingSpecs
 2021  -> (Double) -- ^invEps
 2022  -> (FdmScheme) -> IO ((PricingEngine))
 2023 fdG2SwaptionEngine a1 a2 a3 a4 a5 a6 a7 =
 2024   withG2 a1 $ \a1' -> 
 2025   let {a2' = fromIntegral a2} in 
 2026   let {a3' = fromIntegral a3} in 
 2027   let {a4' = fromIntegral a4} in 
 2028   let {a5' = fromIntegral a5} in 
 2029   let {a6' = realToFrac a6} in 
 2030   withFdmSchemeDesc a7 $ \a7' -> 
 2031   preErrorCheck $ \a8' -> 
 2032   fdG2SwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 2033   peekPricingEngine res >>= \res' ->
 2034   errorCheck  a8'>>
 2035   return (res')
 2036 
 2037 
 2038 
 2039 -- |finite-differences swaption pricing engine for the Hull-White short-rate model
 2040 fdHullWhiteSwaptionEngine :: (HullWhite) -> (Word) -- ^tGrid
 2041  -> (Word) -- ^xGrid
 2042  -> (Word) -- ^dampingSpecs
 2043  -> (Double) -- ^invEps
 2044  -> (FdmScheme) -> IO ((PricingEngine))
 2045 fdHullWhiteSwaptionEngine a1 a2 a3 a4 a5 a6 =
 2046   withHullWhite a1 $ \a1' -> 
 2047   let {a2' = fromIntegral a2} in 
 2048   let {a3' = fromIntegral a3} in 
 2049   let {a4' = fromIntegral a4} in 
 2050   let {a5' = realToFrac a5} in 
 2051   withFdmSchemeDesc a6 $ \a6' -> 
 2052   preErrorCheck $ \a7' -> 
 2053   fdHullWhiteSwaptionEngine'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 2054   peekPricingEngine res >>= \res' ->
 2055   errorCheck  a7'>>
 2056   return (res')
 2057 
 2058 
 2059 
 2060 -- |finite-differences Black-Scholes barrier-option pricing engine
 2061 fdBlackScholesBarrierEngine :: (GeneralizedBlackScholesProcess) -> (Word) -- ^tGrid
 2062  -> (Word) -- ^xGrid
 2063  -> (Word) -- ^dampingSteps
 2064  -> (FdmScheme) -> (Bool) -- ^localVol
 2065  -> (Double) -- ^illegalLocalVolOverwrite
 2066  -> IO ((PricingEngine))
 2067 fdBlackScholesBarrierEngine a1 a2 a3 a4 a5 a6 a7 =
 2068   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 2069   let {a2' = fromIntegral a2} in 
 2070   let {a3' = fromIntegral a3} in 
 2071   let {a4' = fromIntegral a4} in 
 2072   withFdmSchemeDesc a5 $ \a5' -> 
 2073   let {a6' = C2HSImp.fromBool a6} in 
 2074   let {a7' = realToFrac a7} in 
 2075   preErrorCheck $ \a8' -> 
 2076   fdBlackScholesBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 2077   peekPricingEngine res >>= \res' ->
 2078   errorCheck  a8'>>
 2079   return (res')
 2080 
 2081 
 2082 
 2083 -- |finite-differences Heston-model barrier-option pricing engine
 2084 fdHestonBarrierEngine :: (GenHestonModel hm) -> (Word) -- ^tGrid
 2085  -> (Word) -- ^xGrid
 2086  -> (Word) -- ^vGrid
 2087  -> (Word) -- ^dampingSteps
 2088  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2089  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2090  -> IO ((PricingEngine))
 2091 fdHestonBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 =
 2092   withHestonModel a1 $ \a1' -> 
 2093   let {a2' = fromIntegral a2} in 
 2094   let {a3' = fromIntegral a3} in 
 2095   let {a4' = fromIntegral a4} in 
 2096   let {a5' = fromIntegral a5} in 
 2097   withFdmSchemeDesc a6 $ \a6' -> 
 2098   withMaybeLocalVolTermStructure a7 $ \a7' -> 
 2099   let {a8' = realToFrac a8} in 
 2100   preErrorCheck $ \a9' -> 
 2101   fdHestonBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 2102   peekPricingEngine res >>= \res' ->
 2103   errorCheck  a9'>>
 2104   return (res')
 2105 
 2106 
 2107 
 2108 -- |finite-differences Heston-model barrier-option pricing engine, with discrete dividends
 2109 fdHestonBarrierEngine' :: (GenHestonModel hm) -> ([Dividend]) -> (Word) -- ^tGrid
 2110  -> (Word) -- ^xGrid
 2111  -> (Word) -- ^vGrid
 2112  -> (Word) -- ^dampingSteps
 2113  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2114  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2115  -> IO ((PricingEngine))
 2116 fdHestonBarrierEngine' a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2117   withHestonModel a1 $ \a1' -> 
 2118   withDividendArray a2 $ \(a2'1, a2'2) -> 
 2119   let {a3' = fromIntegral a3} in 
 2120   let {a4' = fromIntegral a4} in 
 2121   let {a5' = fromIntegral a5} in 
 2122   let {a6' = fromIntegral a6} in 
 2123   withFdmSchemeDesc a7 $ \a7' -> 
 2124   withMaybeLocalVolTermStructure a8 $ \a8' -> 
 2125   let {a9' = realToFrac a9} in 
 2126   preErrorCheck $ \a10' -> 
 2127   fdHestonBarrierEngine''_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2128   peekPricingEngine res >>= \res' ->
 2129   errorCheck  a10'>>
 2130   return (res')
 2131 
 2132 
 2133 
 2134 -- |finite-differences Heston-model double-barrier-option pricing engine
 2135 fdHestonDoubleBarrierEngine :: (GenHestonModel hm) -> (Word) -- ^tGrid
 2136  -> (Word) -- ^xGrid
 2137  -> (Word) -- ^vGrid
 2138  -> (Word) -- ^dampingSteps
 2139  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2140  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2141  -> IO ((PricingEngine))
 2142 fdHestonDoubleBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 =
 2143   withHestonModel a1 $ \a1' -> 
 2144   let {a2' = fromIntegral a2} in 
 2145   let {a3' = fromIntegral a3} in 
 2146   let {a4' = fromIntegral a4} in 
 2147   let {a5' = fromIntegral a5} in 
 2148   withFdmSchemeDesc a6 $ \a6' -> 
 2149   withMaybeLocalVolTermStructure a7 $ \a7' -> 
 2150   let {a8' = realToFrac a8} in 
 2151   preErrorCheck $ \a9' -> 
 2152   fdHestonDoubleBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 2153   peekPricingEngine res >>= \res' ->
 2154   errorCheck  a9'>>
 2155   return (res')
 2156 
 2157 
 2158 
 2159 -- |/NB/ every Monte Carlo engine in this module is C++-templated on both an RNG policy and a
 2160 -- statistics accumulator; all of them (bar 'mcAmericanBasketEngine', see its own doc comment)
 2161 -- take an explicit 'StatisticsTrait' argument for the latter, letting the caller pick
 2162 -- 'Statistics'\/'GaussianStatistics'\/'GeneralStatistics'\/'IncrementalStatistics' instead of being
 2163 -- pinned to upstream's default @Statistics@.
 2164 mcHestonHullWhiteEngine :: (RngTrait) -> (StatisticsTrait) -> (HybridHestonHullWhiteProcess) -> (Maybe Word) -- ^timeSteps
 2165  -> (Maybe Word) -- ^timStepsPerYear
 2166  -> (Bool) -- ^antitheticVariate
 2167  -> (Bool) -- ^controlVariate
 2168  -> (Maybe Word) -- ^requiredSamples
 2169  -> (Maybe Double) -- ^requiredTolerance
 2170  -> (Maybe Word) -- ^maxSamples
 2171  -> (Word) -- ^seed
 2172  -> IO ((PricingEngine))
 2173 mcHestonHullWhiteEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 2174   let {a1' = (fromIntegral . fromEnum) a1} in 
 2175   let {a2' = (fromIntegral . fromEnum) a2} in 
 2176   withGenStochasticProcess a3 $ \a3' -> 
 2177   let {a4' = fromMaybeInt a4} in 
 2178   let {a5' = fromMaybeInt a5} in 
 2179   let {a6' = C2HSImp.fromBool a6} in 
 2180   let {a7' = C2HSImp.fromBool a7} in 
 2181   let {a8' = fromMaybeInt a8} in 
 2182   let {a9' = fromMaybeDouble a9} in 
 2183   let {a10' = fromMaybeInt a10} in 
 2184   let {a11' = fromIntegral a11} in 
 2185   preErrorCheck $ \a12' -> 
 2186   mcHestonHullWhiteEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 2187   peekPricingEngine res >>= \res' ->
 2188   errorCheck  a12'>>
 2189   return (res')
 2190 
 2191 
 2192 
 2193 -- |Monte Carlo (least-squares) pricing engine for American options
 2194 mcAmericanEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -> (Maybe Word) -- ^timeStepsPerYear
 2195  -> (Bool) -- ^antitheticVariate
 2196  -> (Bool) -- ^controlVariate
 2197  -> (Maybe Word) -- ^requiredSamples
 2198  -> (Maybe Double) -- ^requiredTolerance
 2199  -> (Maybe Word) -- ^maxSamples
 2200  -> (Word) -- ^seed
 2201  -> (Word) -- ^polynomOrder
 2202  -> (PolynomialType) -> (Maybe Word) -- ^nCalibrationSamples
 2203  -> (Maybe Bool) -- ^antitheticVariateCalibration
 2204  -> (Maybe Word) -- ^seedCalibration
 2205  -> IO ((PricingEngine))
 2206 mcAmericanEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 =
 2207   let {a1' = (fromIntegral . fromEnum) a1} in 
 2208   let {a2' = (fromIntegral . fromEnum) a2} in 
 2209   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2210   let {a4' = fromMaybeInt a4} in 
 2211   let {a5' = fromMaybeInt a5} in 
 2212   let {a6' = C2HSImp.fromBool a6} in 
 2213   let {a7' = C2HSImp.fromBool a7} in 
 2214   let {a8' = fromMaybeInt a8} in 
 2215   let {a9' = fromMaybeDouble a9} in 
 2216   let {a10' = fromMaybeInt a10} in 
 2217   let {a11' = fromIntegral a11} in 
 2218   let {a12' = fromIntegral a12} in 
 2219   let {a13' = (fromIntegral . fromEnum) a13} in 
 2220   let {a14' = fromMaybeInt a14} in 
 2221   let {a15' = fromMaybeBool a15} in 
 2222   let {a16' = fromMaybeInt a16} in 
 2223   preErrorCheck $ \a17' -> 
 2224   mcAmericanEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' a17' >>= \res ->
 2225   peekPricingEngine res >>= \res' ->
 2226   errorCheck  a17'>>
 2227   return (res')
 2228 
 2229 
 2230 
 2231 -- |Monte Carlo pricing engine for barrier options
 2232 mcBarrierEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 2233  -> (Maybe Word) -- ^timeStepsPerYear
 2234  -> (Bool) -- ^brownianBridge
 2235  -> (Bool) -- ^antitheticVariate
 2236  -> (Maybe Word) -- ^requiredSamples
 2237  -> (Maybe Double) -- ^requiredTolerance
 2238  -> (Maybe Word) -- ^maxSamples
 2239  -> (Bool) -- ^isBiased
 2240  -> (Word) -- ^seed
 2241  -> IO ((PricingEngine))
 2242 mcBarrierEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 =
 2243   let {a1' = (fromIntegral . fromEnum) a1} in 
 2244   let {a2' = (fromIntegral . fromEnum) a2} in 
 2245   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2246   let {a4' = fromMaybeInt a4} in 
 2247   let {a5' = fromMaybeInt a5} in 
 2248   let {a6' = C2HSImp.fromBool a6} in 
 2249   let {a7' = C2HSImp.fromBool a7} in 
 2250   let {a8' = fromMaybeInt a8} in 
 2251   let {a9' = fromMaybeDouble a9} in 
 2252   let {a10' = fromMaybeInt a10} in 
 2253   let {a11' = C2HSImp.fromBool a11} in 
 2254   let {a12' = fromIntegral a12} in 
 2255   preErrorCheck $ \a13' -> 
 2256   mcBarrierEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' >>= \res ->
 2257   peekPricingEngine res >>= \res' ->
 2258   errorCheck  a13'>>
 2259   return (res')
 2260 
 2261 
 2262 
 2263 -- |Monte Carlo pricing engine for digital (cash-or-nothing/asset-or-nothing) options
 2264 mcDigitalEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 2265  -> (Maybe Word) -> (Bool) -> (Bool) -> (Maybe Word) -- ^requiredSamples
 2266  -> (Maybe Double) -- ^requiredTolerance
 2267  -> (Maybe Word) -- ^maxSamples
 2268  -> (Word) -- ^seed
 2269  -> IO ((PricingEngine))
 2270 mcDigitalEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 2271   let {a1' = (fromIntegral . fromEnum) a1} in 
 2272   let {a2' = (fromIntegral . fromEnum) a2} in 
 2273   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2274   let {a4' = fromMaybeInt a4} in 
 2275   let {a5' = fromMaybeInt a5} in 
 2276   let {a6' = C2HSImp.fromBool a6} in 
 2277   let {a7' = C2HSImp.fromBool a7} in 
 2278   let {a8' = fromMaybeInt a8} in 
 2279   let {a9' = fromMaybeDouble a9} in 
 2280   let {a10' = fromMaybeInt a10} in 
 2281   let {a11' = fromIntegral a11} in 
 2282   preErrorCheck $ \a12' -> 
 2283   mcDigitalEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 2284   peekPricingEngine res >>= \res' ->
 2285   errorCheck  a12'>>
 2286   return (res')
 2287 
 2288 
 2289 
 2290 -- |Monte Carlo pricing engine for discrete arithmetic average-price Asian options
 2291 mcDiscreteArithmeticAPEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 2292  -> (Bool) -- ^antitheticVariate
 2293  -> (Bool) -- ^controlVariate
 2294  -> (Maybe Word) -- ^requiredSamples
 2295  -> (Maybe Double) -- ^requiredTolerance
 2296  -> (Maybe Word) -- ^maxSamples
 2297  -> (Word) -- ^seed
 2298  -> IO ((PricingEngine))
 2299 mcDiscreteArithmeticAPEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
 2300   let {a1' = (fromIntegral . fromEnum) a1} in 
 2301   let {a2' = (fromIntegral . fromEnum) a2} in 
 2302   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2303   let {a4' = C2HSImp.fromBool a4} in 
 2304   let {a5' = C2HSImp.fromBool a5} in 
 2305   let {a6' = C2HSImp.fromBool a6} in 
 2306   let {a7' = fromMaybeInt a7} in 
 2307   let {a8' = fromMaybeDouble a8} in 
 2308   let {a9' = fromMaybeInt a9} in 
 2309   let {a10' = fromIntegral a10} in 
 2310   preErrorCheck $ \a11' -> 
 2311   mcDiscreteArithmeticAPEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
 2312   peekPricingEngine res >>= \res' ->
 2313   errorCheck  a11'>>
 2314   return (res')
 2315 
 2316 
 2317 
 2318 -- |Monte Carlo pricing engine for discrete arithmetic average-strike Asian options
 2319 mcDiscreteArithmeticASEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 2320  -> (Bool) -- ^antitheticVariate
 2321  -> (Maybe Word) -- ^requiredSamples
 2322  -> (Maybe Double) -- ^requiredTolerance
 2323  -> (Maybe Word) -- ^maxSamples
 2324  -> (Word) -- ^seed
 2325  -> IO ((PricingEngine))
 2326 mcDiscreteArithmeticASEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2327   let {a1' = (fromIntegral . fromEnum) a1} in 
 2328   let {a2' = (fromIntegral . fromEnum) a2} in 
 2329   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2330   let {a4' = C2HSImp.fromBool a4} in 
 2331   let {a5' = C2HSImp.fromBool a5} in 
 2332   let {a6' = fromMaybeInt a6} in 
 2333   let {a7' = fromMaybeDouble a7} in 
 2334   let {a8' = fromMaybeInt a8} in 
 2335   let {a9' = fromIntegral a9} in 
 2336   preErrorCheck $ \a10' -> 
 2337   mcDiscreteArithmeticASEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2338   peekPricingEngine res >>= \res' ->
 2339   errorCheck  a10'>>
 2340   return (res')
 2341 
 2342 
 2343 
 2344 -- |Monte Carlo pricing engine for discrete geometric average-price Asian options
 2345 mcDiscreteGeometricAPEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 2346  -> (Bool) -- ^antitheticVariate
 2347  -> (Maybe Word) -- ^requiredSamples
 2348  -> (Maybe Double) -- ^requiredTolerance
 2349  -> (Maybe Word) -- ^maxSamples
 2350  -> (Word) -- ^seed
 2351  -> IO ((PricingEngine))
 2352 mcDiscreteGeometricAPEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2353   let {a1' = (fromIntegral . fromEnum) a1} in 
 2354   let {a2' = (fromIntegral . fromEnum) a2} in 
 2355   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2356   let {a4' = C2HSImp.fromBool a4} in 
 2357   let {a5' = C2HSImp.fromBool a5} in 
 2358   let {a6' = fromMaybeInt a6} in 
 2359   let {a7' = fromMaybeDouble a7} in 
 2360   let {a8' = fromMaybeInt a8} in 
 2361   let {a9' = fromIntegral a9} in 
 2362   preErrorCheck $ \a10' -> 
 2363   mcDiscreteGeometricAPEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2364   peekPricingEngine res >>= \res' ->
 2365   errorCheck  a10'>>
 2366   return (res')
 2367 
 2368 
 2369 
 2370 -- |Monte Carlo pricing engine for European options under a Black-Scholes process
 2371 mcEuropeanEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 2372  -> (Maybe Word) -- ^timeStepsPerYear
 2373  -> (Bool) -- ^brownianBridge
 2374  -> (Bool) -- ^antitheticVariate
 2375  -> (Maybe Word) -- ^requiredSamples
 2376  -> (Maybe Double) -- ^requiredTolerance
 2377  -> (Maybe Word) -- ^maxSamples
 2378  -> (Word) -- ^seed
 2379  -> IO ((PricingEngine))
 2380 mcEuropeanEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 2381   let {a1' = (fromIntegral . fromEnum) a1} in 
 2382   let {a2' = (fromIntegral . fromEnum) a2} in 
 2383   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2384   let {a4' = fromMaybeInt a4} in 
 2385   let {a5' = fromMaybeInt a5} in 
 2386   let {a6' = C2HSImp.fromBool a6} in 
 2387   let {a7' = C2HSImp.fromBool a7} in 
 2388   let {a8' = fromMaybeInt a8} in 
 2389   let {a9' = fromMaybeDouble a9} in 
 2390   let {a10' = fromMaybeInt a10} in 
 2391   let {a11' = fromIntegral a11} in 
 2392   preErrorCheck $ \a12' -> 
 2393   mcEuropeanEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 2394   peekPricingEngine res >>= \res' ->
 2395   errorCheck  a12'>>
 2396   return (res')
 2397 
 2398 
 2399 
 2400 -- |Monte Carlo pricing engine for European options under a GJR-GARCH process
 2401 mcEuropeanGJRGARCHEngine :: (RngTrait) -> (StatisticsTrait) -> (GJRGARCHProcess) -> (Maybe Word) -- ^timeSteps
 2402  -> (Maybe Word) -- ^timeStepsPerYear
 2403  -> (Bool) -- ^antitheticVariate
 2404  -> (Maybe Word) -- ^requiredSamples
 2405  -> (Maybe Double) -- ^requiredTolerance
 2406  -> (Maybe Word) -- ^maxSamples
 2407  -> (Word) -- ^seed
 2408  -> IO ((PricingEngine))
 2409 mcEuropeanGJRGARCHEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
 2410   let {a1' = (fromIntegral . fromEnum) a1} in 
 2411   let {a2' = (fromIntegral . fromEnum) a2} in 
 2412   withGenStochasticProcess a3 $ \a3' -> 
 2413   let {a4' = fromMaybeInt a4} in 
 2414   let {a5' = fromMaybeInt a5} in 
 2415   let {a6' = C2HSImp.fromBool a6} in 
 2416   let {a7' = fromMaybeInt a7} in 
 2417   let {a8' = fromMaybeDouble a8} in 
 2418   let {a9' = fromMaybeInt a9} in 
 2419   let {a10' = fromIntegral a10} in 
 2420   preErrorCheck $ \a11' -> 
 2421   mcEuropeanGJRGARCHEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
 2422   peekPricingEngine res >>= \res' ->
 2423   errorCheck  a11'>>
 2424   return (res')
 2425 
 2426 
 2427 
 2428 -- |Monte Carlo pricing engine for European options under a Heston process
 2429 mcEuropeanHestonEngine :: (RngTrait) -> (StatisticsTrait) -> (GenHestonProcess hp) -> (Maybe Word) -- ^timeSteps
 2430  -> (Maybe Word) -- ^timeStepsPerYear
 2431  -> (Bool) -- ^antitheticVariate
 2432  -> (Maybe Word) -- ^requiredSamples
 2433  -> (Maybe Double) -- ^requiredTolerance
 2434  -> (Maybe Word) -- ^maxSamples
 2435  -> (Word) -- ^seed
 2436  -> IO ((PricingEngine))
 2437 mcEuropeanHestonEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
 2438   let {a1' = (fromIntegral . fromEnum) a1} in 
 2439   let {a2' = (fromIntegral . fromEnum) a2} in 
 2440   withHestonProcess a3 $ \a3' -> 
 2441   let {a4' = fromMaybeInt a4} in 
 2442   let {a5' = fromMaybeInt a5} in 
 2443   let {a6' = C2HSImp.fromBool a6} in 
 2444   let {a7' = fromMaybeInt a7} in 
 2445   let {a8' = fromMaybeDouble a8} in 
 2446   let {a9' = fromMaybeInt a9} in 
 2447   let {a10' = fromIntegral a10} in 
 2448   preErrorCheck $ \a11' -> 
 2449   mcEuropeanHestonEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
 2450   peekPricingEngine res >>= \res' ->
 2451   errorCheck  a11'>>
 2452   return (res')
 2453 
 2454 
 2455 
 2456 -- |Prices a 'VarianceOption' by integrating its payoff against the Heston-model transition density.
 2457 integralHestonVarianceOptionEngine :: (GenHestonProcess hp) -> IO ((PricingEngine))
 2458 integralHestonVarianceOptionEngine a1 =
 2459   withHestonProcess a1 $ \a1' -> 
 2460   preErrorCheck $ \a2' -> 
 2461   integralHestonVarianceOptionEngine'_ a1' a2' >>= \res ->
 2462   peekPricingEngine res >>= \res' ->
 2463   errorCheck  a2'>>
 2464   return (res')
 2465 
 2466 
 2467 
 2468 -- |Monte Carlo Hull-White pricing engine for caps\/floors
 2469 mcHullWhiteCapFloorEngine :: (RngTrait) -> (StatisticsTrait) -> (HullWhite) -> (Bool) -- ^brownianBridge
 2470  -> (Bool) -- ^antitheticVariate
 2471  -> (Maybe Word) -- ^requiredSamples
 2472  -> (Maybe Double) -- ^requiredTolerance
 2473  -> (Maybe Word) -- ^maxSamples
 2474  -> (Word) -- ^seed
 2475  -> IO ((PricingEngine))
 2476 mcHullWhiteCapFloorEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2477   let {a1' = (fromIntegral . fromEnum) a1} in 
 2478   let {a2' = (fromIntegral . fromEnum) a2} in 
 2479   withHullWhite a3 $ \a3' -> 
 2480   let {a4' = C2HSImp.fromBool a4} in 
 2481   let {a5' = C2HSImp.fromBool a5} in 
 2482   let {a6' = fromMaybeInt a6} in 
 2483   let {a7' = fromMaybeDouble a7} in 
 2484   let {a8' = fromMaybeInt a8} in 
 2485   let {a9' = fromIntegral a9} in 
 2486   preErrorCheck $ \a10' -> 
 2487   mcHullWhiteCapFloorEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2488   peekPricingEngine res >>= \res' ->
 2489   errorCheck  a10'>>
 2490   return (res')
 2491 
 2492 
 2493 
 2494 -- |Monte Carlo pricing engine for 'himalayaOption'
 2495 mcHimalayaEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Bool) -- ^brownianBridge
 2496  -> (Bool) -- ^antitheticVariate
 2497  -> (Maybe Word) -- ^requiredSamples
 2498  -> (Maybe Double) -- ^requiredTolerance
 2499  -> (Maybe Word) -- ^maxSamples
 2500  -> (Word) -- ^seed
 2501  -> IO ((PricingEngine))
 2502 mcHimalayaEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2503   let {a1' = (fromIntegral . fromEnum) a1} in 
 2504   let {a2' = (fromIntegral . fromEnum) a2} in 
 2505   withGenStochasticProcess a3 $ \a3' -> 
 2506   let {a4' = C2HSImp.fromBool a4} in 
 2507   let {a5' = C2HSImp.fromBool a5} in 
 2508   let {a6' = fromMaybeInt a6} in 
 2509   let {a7' = fromMaybeDouble a7} in 
 2510   let {a8' = fromMaybeInt a8} in 
 2511   let {a9' = fromIntegral a9} in 
 2512   preErrorCheck $ \a10' -> 
 2513   mcHimalayaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2514   peekPricingEngine res >>= \res' ->
 2515   errorCheck  a10'>>
 2516   return (res')
 2517 
 2518 
 2519 
 2520 -- |Monte Carlo pricing engine for 'pagodaOption'
 2521 mcPagodaEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Bool) -- ^brownianBridge
 2522  -> (Bool) -- ^antitheticVariate
 2523  -> (Maybe Word) -- ^requiredSamples
 2524  -> (Maybe Double) -- ^requiredTolerance
 2525  -> (Maybe Word) -- ^maxSamples
 2526  -> (Word) -- ^seed
 2527  -> IO ((PricingEngine))
 2528 mcPagodaEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2529   let {a1' = (fromIntegral . fromEnum) a1} in 
 2530   let {a2' = (fromIntegral . fromEnum) a2} in 
 2531   withGenStochasticProcess a3 $ \a3' -> 
 2532   let {a4' = C2HSImp.fromBool a4} in 
 2533   let {a5' = C2HSImp.fromBool a5} in 
 2534   let {a6' = fromMaybeInt a6} in 
 2535   let {a7' = fromMaybeDouble a7} in 
 2536   let {a8' = fromMaybeInt a8} in 
 2537   let {a9' = fromIntegral a9} in 
 2538   preErrorCheck $ \a10' -> 
 2539   mcPagodaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2540   peekPricingEngine res >>= \res' ->
 2541   errorCheck  a10'>>
 2542   return (res')
 2543 
 2544 
 2545 
 2546 -- |Monte Carlo pricing engine for a European 'basketOption'.
 2547 mcEuropeanBasketEngine :: (RngTrait) -> (StatisticsTrait) -> (StochasticProcessArray) -> (Maybe Word) -- ^timeSteps
 2548  -> (Maybe Word) -- ^timeStepsPerYear
 2549  -> (Bool) -- ^brownianBridge
 2550  -> (Bool) -- ^antitheticVariate
 2551  -> (Maybe Word) -- ^requiredSamples
 2552  -> (Maybe Double) -- ^requiredTolerance
 2553  -> (Maybe Word) -- ^maxSamples
 2554  -> (Word) -- ^seed
 2555  -> IO ((PricingEngine))
 2556 mcEuropeanBasketEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 2557   let {a1' = (fromIntegral . fromEnum) a1} in 
 2558   let {a2' = (fromIntegral . fromEnum) a2} in 
 2559   withGenStochasticProcess a3 $ \a3' -> 
 2560   let {a4' = fromMaybeInt a4} in 
 2561   let {a5' = fromMaybeInt a5} in 
 2562   let {a6' = C2HSImp.fromBool a6} in 
 2563   let {a7' = C2HSImp.fromBool a7} in 
 2564   let {a8' = fromMaybeInt a8} in 
 2565   let {a9' = fromMaybeDouble a9} in 
 2566   let {a10' = fromMaybeInt a10} in 
 2567   let {a11' = fromIntegral a11} in 
 2568   preErrorCheck $ \a12' -> 
 2569   mcEuropeanBasketEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 2570   peekPricingEngine res >>= \res' ->
 2571   errorCheck  a12'>>
 2572   return (res')
 2573 
 2574 
 2575 
 2576 -- |Monte Carlo (least-squares) pricing engine for an American 'basketOption'. /NB/ unlike every
 2577 -- other MC engine in this module, this one has no 'StatisticsTrait' parameter: upstream's
 2578 -- @MCAmericanBasketEngine\<RNG\>@ is templated on @RNG@ only -- its base
 2579 -- @MCLongstaffSchwartzEngine\<BasketOption::engine,MultiVariate,RNG\>@ never forwards a second
 2580 -- template argument, so there is no @S@ to expose here (a real upstream limitation, not an
 2581 -- oversight).
 2582 mcAmericanBasketEngine :: (RngTrait) -> (StochasticProcessArray) -> (Maybe Word) -- ^timeSteps
 2583  -> (Maybe Word) -- ^timeStepsPerYear
 2584  -> (Bool) -- ^brownianBridge
 2585  -> (Bool) -- ^antitheticVariate
 2586  -> (Maybe Word) -- ^requiredSamples
 2587  -> (Maybe Double) -- ^requiredTolerance
 2588  -> (Maybe Word) -- ^maxSamples
 2589  -> (Word) -- ^seed
 2590  -> (Maybe Word) -- ^nCalibrationSamples
 2591  -> (Word) -- ^polynomialOrder
 2592  -> (PolynomialType) -- ^polynomialType
 2593  -> IO ((PricingEngine))
 2594 mcAmericanBasketEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 =
 2595   let {a1' = (fromIntegral . fromEnum) a1} in 
 2596   withGenStochasticProcess a2 $ \a2' -> 
 2597   let {a3' = fromMaybeInt a3} in 
 2598   let {a4' = fromMaybeInt a4} in 
 2599   let {a5' = C2HSImp.fromBool a5} in 
 2600   let {a6' = C2HSImp.fromBool a6} in 
 2601   let {a7' = fromMaybeInt a7} in 
 2602   let {a8' = fromMaybeDouble a8} in 
 2603   let {a9' = fromMaybeInt a9} in 
 2604   let {a10' = fromIntegral a10} in 
 2605   let {a11' = fromMaybeInt a11} in 
 2606   let {a12' = fromIntegral a12} in 
 2607   let {a13' = (fromIntegral . fromEnum) a13} in 
 2608   preErrorCheck $ \a14' -> 
 2609   mcAmericanBasketEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' >>= \res ->
 2610   peekPricingEngine res >>= \res' ->
 2611   errorCheck  a14'>>
 2612   return (res')
 2613 
 2614 
 2615 
 2616 -- |Monte Carlo pricing engine for performance (return) options
 2617 mcPerformanceEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Bool) -- ^brownianBridge
 2618  -> (Bool) -- ^antitheticVariate
 2619  -> (Maybe Word) -- ^requiredSamples
 2620  -> (Maybe Double) -- ^requiredTolerance
 2621  -> (Maybe Word) -- ^maxSamples
 2622  -> (Word) -- ^seed
 2623  -> IO ((PricingEngine))
 2624 mcPerformanceEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2625   let {a1' = (fromIntegral . fromEnum) a1} in 
 2626   let {a2' = (fromIntegral . fromEnum) a2} in 
 2627   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2628   let {a4' = C2HSImp.fromBool a4} in 
 2629   let {a5' = C2HSImp.fromBool a5} in 
 2630   let {a6' = fromMaybeInt a6} in 
 2631   let {a7' = fromMaybeDouble a7} in 
 2632   let {a8' = fromMaybeInt a8} in 
 2633   let {a9' = fromIntegral a9} in 
 2634   preErrorCheck $ \a10' -> 
 2635   mcPerformanceEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2636   peekPricingEngine res >>= \res' ->
 2637   errorCheck  a10'>>
 2638   return (res')
 2639 
 2640 
 2641 
 2642 -- |variance-swap pricing engine using Monte Carlo simulation (see the note above
 2643 -- 'mcHestonHullWhiteEngine' for the 'StatisticsTrait' parameter shared by every MC engine here).
 2644 mcVarianceSwapEngine :: (RngTrait) -> (StatisticsTrait) -> (GeneralizedBlackScholesProcess) -> (Maybe Word) -- ^timeSteps
 2645  -> (Maybe Word) -- ^timeStepsPerYear
 2646  -> (Bool) -- ^brownianBridge
 2647  -> (Bool) -- ^antitheticVariate
 2648  -> (Maybe Word) -- ^requiredSamples
 2649  -> (Maybe Double) -- ^requiredTolerance
 2650  -> (Maybe Word) -- ^maxSamples
 2651  -> (Word) -- ^seed
 2652  -> IO ((PricingEngine))
 2653 mcVarianceSwapEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 2654   let {a1' = (fromIntegral . fromEnum) a1} in 
 2655   let {a2' = (fromIntegral . fromEnum) a2} in 
 2656   withGeneralizedBlackScholesProcess a3 $ \a3' -> 
 2657   let {a4' = fromMaybeInt a4} in 
 2658   let {a5' = fromMaybeInt a5} in 
 2659   let {a6' = C2HSImp.fromBool a6} in 
 2660   let {a7' = C2HSImp.fromBool a7} in 
 2661   let {a8' = fromMaybeInt a8} in 
 2662   let {a9' = fromMaybeDouble a9} in 
 2663   let {a10' = fromMaybeInt a10} in 
 2664   let {a11' = fromIntegral a11} in 
 2665   preErrorCheck $ \a12' -> 
 2666   mcVarianceSwapEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 2667   peekPricingEngine res >>= \res' ->
 2668   errorCheck  a12'>>
 2669   return (res')
 2670 
 2671 
 2672 
 2673 -- |pricing engine for vanilla options using binomial trees
 2674 binomialVanillaEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 2675  -> IO ((PricingEngine))
 2676 binomialVanillaEngine a1 a2 a3 =
 2677   let {a1' = (fromIntegral . fromEnum) a1} in 
 2678   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
 2679   let {a3' = fromIntegral a3} in 
 2680   preErrorCheck $ \a4' -> 
 2681   binomialVanillaEngine'_ a1' a2' a3' a4' >>= \res ->
 2682   peekPricingEngine res >>= \res' ->
 2683   errorCheck  a4'>>
 2684   return (res')
 2685 
 2686 
 2687 
 2688 -- |finite-differences Black-Scholes pricing engine for discrete-averaging Asian options
 2689 fdBlackScholesAsianEngine :: (GeneralizedBlackScholesProcess) -> (Word) -- ^tGrid
 2690  -> (Word) -- ^xGrid
 2691  -> (Word) -- ^aGrid
 2692  -> (FdmScheme) -> IO ((PricingEngine))
 2693 fdBlackScholesAsianEngine a1 a2 a3 a4 a5 =
 2694   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 2695   let {a2' = fromIntegral a2} in 
 2696   let {a3' = fromIntegral a3} in 
 2697   let {a4' = fromIntegral a4} in 
 2698   withFdmSchemeDesc a5 $ \a5' -> 
 2699   preErrorCheck $ \a6' -> 
 2700   fdBlackScholesAsianEngine'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 2701   peekPricingEngine res >>= \res' ->
 2702   errorCheck  a6'>>
 2703   return (res')
 2704 
 2705 
 2706 
 2707 -- |finite-differences Black-Scholes pricing engine for vanilla options
 2708 fdBlackScholesVanillaEngine :: (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 2709  -> (Word) -- ^gridPoints
 2710  -> (Word) -- ^timeDependent
 2711  -> (FdmScheme) -> (Bool) -- ^localVol
 2712  -> (Double) -- ^illegalLocalVolOverwrite
 2713  -> (CashDividendModel) -- ^cashDividendModel
 2714  -> IO ((PricingEngine))
 2715 fdBlackScholesVanillaEngine a1 a2 a3 a4 a5 a6 a7 a8 =
 2716   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 2717   let {a2' = fromIntegral a2} in 
 2718   let {a3' = fromIntegral a3} in 
 2719   let {a4' = fromIntegral a4} in 
 2720   withFdmSchemeDesc a5 $ \a5' -> 
 2721   let {a6' = C2HSImp.fromBool a6} in 
 2722   let {a7' = realToFrac a7} in 
 2723   let {a8' = (fromIntegral . fromEnum) a8} in 
 2724   preErrorCheck $ \a9' -> 
 2725   fdBlackScholesVanillaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 2726   peekPricingEngine res >>= \res' ->
 2727   errorCheck  a9'>>
 2728   return (res')
 2729 
 2730 
 2731 
 2732 -- |finite-differences Black-Scholes pricing engine for vanilla options, with discrete dividends
 2733 fdBlackScholesVanillaEngine' :: (GeneralizedBlackScholesProcess) -> ([Dividend]) -> (Word) -- ^timeSteps
 2734  -> (Word) -- ^gridPoints
 2735  -> (Word) -- ^timeDependent
 2736  -> (FdmScheme) -> (Bool) -- ^localVol
 2737  -> (Double) -- ^illegalLocalVolOverwrite
 2738  -> (CashDividendModel) -- ^cashDividendModel
 2739  -> IO ((PricingEngine))
 2740 fdBlackScholesVanillaEngine' a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2741   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 2742   withDividendArray a2 $ \(a2'1, a2'2) -> 
 2743   let {a3' = fromIntegral a3} in 
 2744   let {a4' = fromIntegral a4} in 
 2745   let {a5' = fromIntegral a5} in 
 2746   withFdmSchemeDesc a6 $ \a6' -> 
 2747   let {a7' = C2HSImp.fromBool a7} in 
 2748   let {a8' = realToFrac a8} in 
 2749   let {a9' = (fromIntegral . fromEnum) a9} in 
 2750   preErrorCheck $ \a10' -> 
 2751   fdBlackScholesVanillaEngine''_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2752   peekPricingEngine res >>= \res' ->
 2753   errorCheck  a10'>>
 2754   return (res')
 2755 
 2756 
 2757 
 2758 -- |finite-differences Black-Scholes pricing engine for vanilla options, with quanto adjustment
 2759 fdBlackScholesVanillaEngineQuanto :: (GeneralizedBlackScholesProcess) -> (Maybe FdmQuantoHelper) -> (Word) -- ^timeSteps
 2760  -> (Word) -- ^gridPoints
 2761  -> (Word) -- ^timeDependent
 2762  -> (FdmScheme) -> (Bool) -- ^localVol
 2763  -> (Double) -- ^illegalLocalVolOverwrite
 2764  -> (CashDividendModel) -- ^cashDividendModel
 2765  -> IO ((PricingEngine))
 2766 fdBlackScholesVanillaEngineQuanto a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2767   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 2768   withMaybeFdmQuantoHelper a2 $ \a2' -> 
 2769   let {a3' = fromIntegral a3} in 
 2770   let {a4' = fromIntegral a4} in 
 2771   let {a5' = fromIntegral a5} in 
 2772   withFdmSchemeDesc a6 $ \a6' -> 
 2773   let {a7' = C2HSImp.fromBool a7} in 
 2774   let {a8' = realToFrac a8} in 
 2775   let {a9' = (fromIntegral . fromEnum) a9} in 
 2776   preErrorCheck $ \a10' -> 
 2777   fdBlackScholesVanillaEngineQuanto'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2778   peekPricingEngine res >>= \res' ->
 2779   errorCheck  a10'>>
 2780   return (res')
 2781 
 2782 
 2783 
 2784 -- |finite-differences Black-Scholes pricing engine for vanilla options, with discrete dividends and quanto adjustment
 2785 fdBlackScholesVanillaEngineQuanto' :: (GeneralizedBlackScholesProcess) -> ([Dividend]) -> (Maybe FdmQuantoHelper) -> (Word) -- ^timeSteps
 2786  -> (Word) -- ^gridPoints
 2787  -> (Word) -- ^timeDependent
 2788  -> (FdmScheme) -> (Bool) -- ^localVol
 2789  -> (Double) -- ^illegalLocalVolOverwrite
 2790  -> (CashDividendModel) -- ^cashDividendModel
 2791  -> IO ((PricingEngine))
 2792 fdBlackScholesVanillaEngineQuanto' a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
 2793   withGeneralizedBlackScholesProcess a1 $ \a1' -> 
 2794   withDividendArray a2 $ \(a2'1, a2'2) -> 
 2795   withMaybeFdmQuantoHelper a3 $ \a3' -> 
 2796   let {a4' = fromIntegral a4} in 
 2797   let {a5' = fromIntegral a5} in 
 2798   let {a6' = fromIntegral a6} in 
 2799   withFdmSchemeDesc a7 $ \a7' -> 
 2800   let {a8' = C2HSImp.fromBool a8} in 
 2801   let {a9' = realToFrac a9} in 
 2802   let {a10' = (fromIntegral . fromEnum) a10} in 
 2803   preErrorCheck $ \a11' -> 
 2804   fdBlackScholesVanillaEngineQuanto''_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
 2805   peekPricingEngine res >>= \res' ->
 2806   errorCheck  a11'>>
 2807   return (res')
 2808 
 2809 
 2810 
 2811 -- |finite-differences Heston-model pricing engine for vanilla options
 2812 fdHestonVanillaEngine :: (GenHestonModel hm) -> (Word) -- ^tGrid
 2813  -> (Word) -- ^xGrid
 2814  -> (Word) -- ^vGrid
 2815  -> (Word) -- ^dampingSteps
 2816  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2817  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2818  -> IO ((PricingEngine))
 2819 fdHestonVanillaEngine a1 a2 a3 a4 a5 a6 a7 a8 =
 2820   withHestonModel a1 $ \a1' -> 
 2821   let {a2' = fromIntegral a2} in 
 2822   let {a3' = fromIntegral a3} in 
 2823   let {a4' = fromIntegral a4} in 
 2824   let {a5' = fromIntegral a5} in 
 2825   withFdmSchemeDesc a6 $ \a6' -> 
 2826   withMaybeLocalVolTermStructure a7 $ \a7' -> 
 2827   let {a8' = realToFrac a8} in 
 2828   preErrorCheck $ \a9' -> 
 2829   fdHestonVanillaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 2830   peekPricingEngine res >>= \res' ->
 2831   errorCheck  a9'>>
 2832   return (res')
 2833 
 2834 
 2835 
 2836 -- |finite-differences Heston-model pricing engine for vanilla options, with discrete dividends
 2837 fdHestonVanillaEngine' :: (GenHestonModel hm) -> ([Dividend]) -> (Word) -- ^tGrid
 2838  -> (Word) -- ^xGrid
 2839  -> (Word) -- ^vGrid
 2840  -> (Word) -- ^dampingSteps
 2841  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2842  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2843  -> IO ((PricingEngine))
 2844 fdHestonVanillaEngine' a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2845   withHestonModel a1 $ \a1' -> 
 2846   withDividendArray a2 $ \(a2'1, a2'2) -> 
 2847   let {a3' = fromIntegral a3} in 
 2848   let {a4' = fromIntegral a4} in 
 2849   let {a5' = fromIntegral a5} in 
 2850   let {a6' = fromIntegral a6} in 
 2851   withFdmSchemeDesc a7 $ \a7' -> 
 2852   withMaybeLocalVolTermStructure a8 $ \a8' -> 
 2853   let {a9' = realToFrac a9} in 
 2854   preErrorCheck $ \a10' -> 
 2855   fdHestonVanillaEngine''_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2856   peekPricingEngine res >>= \res' ->
 2857   errorCheck  a10'>>
 2858   return (res')
 2859 
 2860 
 2861 
 2862 -- |finite-differences Heston-model pricing engine for vanilla options, with quanto adjustment
 2863 fdHestonVanillaEngineQuanto :: (GenHestonModel hm) -> (Maybe FdmQuantoHelper) -> (Word) -- ^tGrid
 2864  -> (Word) -- ^xGrid
 2865  -> (Word) -- ^vGrid
 2866  -> (Word) -- ^dampingSteps
 2867  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2868  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2869  -> IO ((PricingEngine))
 2870 fdHestonVanillaEngineQuanto a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 2871   withHestonModel a1 $ \a1' -> 
 2872   withMaybeFdmQuantoHelper a2 $ \a2' -> 
 2873   let {a3' = fromIntegral a3} in 
 2874   let {a4' = fromIntegral a4} in 
 2875   let {a5' = fromIntegral a5} in 
 2876   let {a6' = fromIntegral a6} in 
 2877   withFdmSchemeDesc a7 $ \a7' -> 
 2878   withMaybeLocalVolTermStructure a8 $ \a8' -> 
 2879   let {a9' = realToFrac a9} in 
 2880   preErrorCheck $ \a10' -> 
 2881   fdHestonVanillaEngineQuanto'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 2882   peekPricingEngine res >>= \res' ->
 2883   errorCheck  a10'>>
 2884   return (res')
 2885 
 2886 
 2887 
 2888 -- |finite-differences Heston-model pricing engine for vanilla options, with discrete dividends and quanto adjustment
 2889 fdHestonVanillaEngineQuanto' :: (GenHestonModel hm) -> ([Dividend]) -> (Maybe FdmQuantoHelper) -> (Word) -- ^tGrid
 2890  -> (Word) -- ^xGrid
 2891  -> (Word) -- ^vGrid
 2892  -> (Word) -- ^dampingSteps
 2893  -> (FdmScheme) -> (Maybe LocalVolTermStructure) -- ^leverageFct
 2894  -> (Double) -- ^mixingFactor, upstream default: 1.0
 2895  -> IO ((PricingEngine))
 2896 fdHestonVanillaEngineQuanto' a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
 2897   withHestonModel a1 $ \a1' -> 
 2898   withDividendArray a2 $ \(a2'1, a2'2) -> 
 2899   withMaybeFdmQuantoHelper a3 $ \a3' -> 
 2900   let {a4' = fromIntegral a4} in 
 2901   let {a5' = fromIntegral a5} in 
 2902   let {a6' = fromIntegral a6} in 
 2903   let {a7' = fromIntegral a7} in 
 2904   withFdmSchemeDesc a8 $ \a8' -> 
 2905   withMaybeLocalVolTermStructure a9 $ \a9' -> 
 2906   let {a10' = realToFrac a10} in 
 2907   preErrorCheck $ \a11' -> 
 2908   fdHestonVanillaEngineQuanto''_ a1' a2'1  a2'2 a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
 2909   peekPricingEngine res >>= \res' ->
 2910   errorCheck  a11'>>
 2911   return (res')
 2912 
 2913 
 2914 
 2915 -- |finite-differences pricing engine for vanilla options combining a Heston equity model with a Hull-White short-rate model
 2916 fdHestonHullWhiteVanillaEngine :: (GenHestonModel hm) -> (HullWhiteProcess) -> (Double) -- ^corrEquityShortRate
 2917  -> (Word) -- ^tGrid
 2918  -> (Word) -- ^xGrid
 2919  -> (Word) -- ^vGrid
 2920  -> (Word) -- ^rGrid
 2921  -> (Word) -- ^dampingSteps
 2922  -> (Bool) -- ^controlVariate, upstream default: true
 2923  -> (FdmScheme) -> IO ((PricingEngine))
 2924 fdHestonHullWhiteVanillaEngine a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
 2925   withHestonModel a1 $ \a1' -> 
 2926   withGenStochasticProcess1D a2 $ \a2' -> 
 2927   let {a3' = realToFrac a3} in 
 2928   let {a4' = fromIntegral a4} in 
 2929   let {a5' = fromIntegral a5} in 
 2930   let {a6' = fromIntegral a6} in 
 2931   let {a7' = fromIntegral a7} in 
 2932   let {a8' = fromIntegral a8} in 
 2933   let {a9' = C2HSImp.fromBool a9} in 
 2934   withFdmSchemeDesc a10 $ \a10' -> 
 2935   preErrorCheck $ \a11' -> 
 2936   fdHestonHullWhiteVanillaEngine'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
 2937   peekPricingEngine res >>= \res' ->
 2938   errorCheck  a11'>>
 2939   return (res')
 2940 
 2941 
 2942 
 2943 -- |finite-differences pricing engine for vanilla options combining a Heston equity model with a Hull-White short-rate model, with discrete dividends
 2944 fdHestonHullWhiteVanillaEngine' :: (GenHestonModel hm) -> (HullWhiteProcess) -> ([Dividend]) -> (Double) -- ^corrEquityShortRate
 2945  -> (Word) -- ^tGrid
 2946  -> (Word) -- ^xGrid
 2947  -> (Word) -- ^vGrid
 2948  -> (Word) -- ^rGrid
 2949  -> (Word) -- ^dampingSteps
 2950  -> (Bool) -- ^controlVariate, upstream default: true
 2951  -> (FdmScheme) -> IO ((PricingEngine))
 2952 fdHestonHullWhiteVanillaEngine' a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 2953   withHestonModel a1 $ \a1' -> 
 2954   withGenStochasticProcess1D a2 $ \a2' -> 
 2955   withDividendArray a3 $ \(a3'1, a3'2) -> 
 2956   let {a4' = realToFrac a4} in 
 2957   let {a5' = fromIntegral a5} in 
 2958   let {a6' = fromIntegral a6} in 
 2959   let {a7' = fromIntegral a7} in 
 2960   let {a8' = fromIntegral a8} in 
 2961   let {a9' = fromIntegral a9} in 
 2962   let {a10' = C2HSImp.fromBool a10} in 
 2963   withFdmSchemeDesc a11 $ \a11' -> 
 2964   preErrorCheck $ \a12' -> 
 2965   fdHestonHullWhiteVanillaEngine''_ a1' a2' a3'1  a3'2 a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
 2966   peekPricingEngine res >>= \res' ->
 2967   errorCheck  a12'>>
 2968   return (res')
 2969 
 2970 
 2971 
 2972 -- |binomial Tsiveriotis-Fernandes pricing engine for convertible bonds
 2973 binomialConvertibleEngine :: (BinomialTree) -> (GeneralizedBlackScholesProcess) -> (Word) -- ^timeSteps
 2974  -> (GenQuote q) -- ^creditSpread
 2975  -> ([Dividend]) -- ^dividends
 2976  -> IO ((PricingEngine))
 2977 binomialConvertibleEngine a1 a2 a3 a4 a5 =
 2978   let {a1' = (fromIntegral . fromEnum) a1} in 
 2979   withGeneralizedBlackScholesProcess a2 $ \a2' -> 
 2980   let {a3' = fromIntegral a3} in 
 2981   withQuote a4 $ \a4' -> 
 2982   withDividendArray a5 $ \(a5'1, a5'2) -> 
 2983   preErrorCheck $ \a6' -> 
 2984   binomialConvertibleEngine'_ a1' a2' a3' a4' a5'1  a5'2 a6' >>= \res ->
 2985   peekPricingEngine res >>= \res' ->
 2986   errorCheck  a6'>>
 2987   return (res')
 2988 
 2989 
 2990 
 2991 -- |volatility is the quoted fwd yield volatility, not price vol
 2992 blackCallableFixedRateBondEngine' :: (CallableBondVolatilityStructure) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
 2993 blackCallableFixedRateBondEngine' a1 a2 =
 2994   withGenTermStructure a1 $ \a1' -> 
 2995   withYieldTermStructure a2 $ \a2' -> 
 2996   preErrorCheck $ \a3' -> 
 2997   blackCallableFixedRateBondEngine''_ a1' a2' a3' >>= \res ->
 2998   peekPricingEngine res >>= \res' ->
 2999   errorCheck  a3'>>
 3000   return (res')
 3001 
 3002 
 3003 
 3004 -- |volatility is the quoted fwd yield volatility, not price vol
 3005 blackCallableFixedRateBondEngine :: (GenQuote q) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
 3006 blackCallableFixedRateBondEngine a1 a2 =
 3007   withQuote a1 $ \a1' -> 
 3008   withYieldTermStructure a2 $ \a2' -> 
 3009   preErrorCheck $ \a3' -> 
 3010   blackCallableFixedRateBondEngine'_ a1' a2' a3' >>= \res ->
 3011   peekPricingEngine res >>= \res' ->
 3012   errorCheck  a3'>>
 3013   return (res')
 3014 
 3015 
 3016 
 3017 -- |volatility is the quoted fwd yield volatility, not price vol
 3018 blackCallableZeroCouponBondEngine' :: (CallableBondVolatilityStructure) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
 3019 blackCallableZeroCouponBondEngine' a1 a2 =
 3020   withGenTermStructure a1 $ \a1' -> 
 3021   withYieldTermStructure a2 $ \a2' -> 
 3022   preErrorCheck $ \a3' -> 
 3023   blackCallableZeroCouponBondEngine''_ a1' a2' a3' >>= \res ->
 3024   peekPricingEngine res >>= \res' ->
 3025   errorCheck  a3'>>
 3026   return (res')
 3027 
 3028 
 3029 
 3030 -- |volatility is the quoted fwd yield volatility, not price vol
 3031 blackCallableZeroCouponBondEngine :: (GenQuote q) -> (GenYieldTermStructure y) -> IO ((PricingEngine))
 3032 blackCallableZeroCouponBondEngine a1 a2 =
 3033   withQuote a1 $ \a1' -> 
 3034   withYieldTermStructure a2 $ \a2' -> 
 3035   preErrorCheck $ \a3' -> 
 3036   blackCallableZeroCouponBondEngine'_ a1' a2' a3' >>= \res ->
 3037   peekPricingEngine res >>= \res' ->
 3038   errorCheck  a3'>>
 3039   return (res')
 3040 
 3041 
 3042 
 3043 -- |numerical-lattice pricing engine for callable fixed-rate bonds, on an explicit time grid
 3044 treeCallableFixedRateBondEngine' :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 3045 treeCallableFixedRateBondEngine' a1 a2 a3 =
 3046   withShortRateModel a1 $ \a1' -> 
 3047   withTimeGrid a2 $ \a2' -> 
 3048   withMaybeYieldTermStructure a3 $ \a3' -> 
 3049   preErrorCheck $ \a4' -> 
 3050   treeCallableFixedRateBondEngine''_ a1' a2' a3' a4' >>= \res ->
 3051   peekPricingEngine res >>= \res' ->
 3052   errorCheck  a4'>>
 3053   return (res')
 3054 
 3055 
 3056 
 3057 -- |numerical-lattice pricing engine for callable fixed-rate bonds
 3058 treeCallableFixedRateBondEngine :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 3059  -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 3060 treeCallableFixedRateBondEngine a1 a2 a3 =
 3061   withShortRateModel a1 $ \a1' -> 
 3062   let {a2' = fromIntegral a2} in 
 3063   withMaybeYieldTermStructure a3 $ \a3' -> 
 3064   preErrorCheck $ \a4' -> 
 3065   treeCallableFixedRateBondEngine'_ a1' a2' a3' a4' >>= \res ->
 3066   peekPricingEngine res >>= \res' ->
 3067   errorCheck  a4'>>
 3068   return (res')
 3069 
 3070 
 3071 
 3072 -- |numerical-lattice pricing engine for callable zero coupon bonds, on an explicit time grid
 3073 treeCallableZeroCouponBondEngine' :: (GenShortRateModel sm) -> (TimeGrid) -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 3074 treeCallableZeroCouponBondEngine' a1 a2 a3 =
 3075   withShortRateModel a1 $ \a1' -> 
 3076   withTimeGrid a2 $ \a2' -> 
 3077   withMaybeYieldTermStructure a3 $ \a3' -> 
 3078   preErrorCheck $ \a4' -> 
 3079   treeCallableZeroCouponBondEngine''_ a1' a2' a3' a4' >>= \res ->
 3080   peekPricingEngine res >>= \res' ->
 3081   errorCheck  a4'>>
 3082   return (res')
 3083 
 3084 
 3085 
 3086 -- |numerical-lattice pricing engine for callable zero coupon bonds
 3087 treeCallableZeroCouponBondEngine :: (GenShortRateModel sm) -> (Word) -- ^timeSteps
 3088  -> (Maybe (GenYieldTermStructure y)) -> IO ((PricingEngine))
 3089 treeCallableZeroCouponBondEngine a1 a2 a3 =
 3090   withShortRateModel a1 $ \a1' -> 
 3091   let {a2' = fromIntegral a2} in 
 3092   withMaybeYieldTermStructure a3 $ \a3' -> 
 3093   preErrorCheck $ \a4' -> 
 3094   treeCallableZeroCouponBondEngine'_ a1' a2' a3' a4' >>= \res ->
 3095   peekPricingEngine res >>= \res' ->
 3096   errorCheck  a4'>>
 3097   return (res')
 3098 
 3099 
 3100 
 3101 -- |intermediate value N'(d1) (or its sign-flipped equivalent) used internally to derive the calculator's Greeks
 3102 alpha :: (GenBlackCalculator bc) -> IO ((Double))
 3103 alpha a1 =
 3104   withBlackCalculator a1 $ \a1' -> 
 3105   preErrorCheck $ \a2' -> 
 3106   alpha'_ a1' a2' >>= \res ->
 3107   let {res' = realToFrac res} in
 3108   errorCheck  a2'>>
 3109   return (res')
 3110 
 3111 
 3112 
 3113 -- |intermediate value N'(d2) (or its sign-flipped equivalent) used internally to derive the calculator's Greeks
 3114 beta :: (GenBlackCalculator bc) -> IO ((Double))
 3115 beta a1 =
 3116   withBlackCalculator a1 $ \a1' -> 
 3117   preErrorCheck $ \a2' -> 
 3118   beta'_ a1' a2' >>= \res ->
 3119   let {res' = realToFrac res} in
 3120   errorCheck  a2'>>
 3121   return (res')
 3122 
 3123 
 3124 
 3125 -- |Black 1976 option-price calculator, from the option type and strike directly
 3126 blackCalculator' :: (OptionType) -> (Double) -- ^strike
 3127  -> (Double) -- ^forward
 3128  -> (Double) -- ^stdDev
 3129  -> (Double) -- ^discount
 3130  -> IO ((BlackCalculator))
 3131 blackCalculator' a1 a2 a3 a4 a5 =
 3132   let {a1' = fromEnumC a1} in 
 3133   let {a2' = realToFrac a2} in 
 3134   let {a3' = realToFrac a3} in 
 3135   let {a4' = realToFrac a4} in 
 3136   let {a5' = realToFrac a5} in 
 3137   preErrorCheck $ \a6' -> 
 3138   blackCalculator''_ a1' a2' a3' a4' a5' a6' >>= \res ->
 3139   peekBlackCalculator res >>= \res' ->
 3140   errorCheck  a6'>>
 3141   return (res')
 3142 
 3143 
 3144 
 3145 -- |Black 1976 option-price calculator, from a striked payoff
 3146 blackCalculator :: (StrikedPayoff) -> (Double) -- ^forward
 3147  -> (Double) -- ^stdDev
 3148  -> (Double) -- ^discount
 3149  -> IO ((BlackCalculator))
 3150 blackCalculator a1 a2 a3 a4 =
 3151   withStrikedPayoff a1 $ \a1' -> 
 3152   let {a2' = realToFrac a2} in 
 3153   let {a3' = realToFrac a3} in 
 3154   let {a4' = realToFrac a4} in 
 3155   preErrorCheck $ \a5' -> 
 3156   blackCalculator'_ a1' a2' a3' a4' a5' >>= \res ->
 3157   peekBlackCalculator res >>= \res' ->
 3158   errorCheck  a5'>>
 3159   return (res')
 3160 
 3161 
 3162 
 3163 -- |Sensitivity to change in the underlying spot price.
 3164 blackDelta :: (GenBlackCalculator bc) -> (Double) -- ^spot
 3165  -> IO ((Double))
 3166 blackDelta a1 a2 =
 3167   withBlackCalculator a1 $ \a1' -> 
 3168   let {a2' = realToFrac a2} in 
 3169   preErrorCheck $ \a3' -> 
 3170   blackDelta'_ a1' a2' a3' >>= \res ->
 3171   let {res' = realToFrac res} in
 3172   errorCheck  a3'>>
 3173   return (res')
 3174 
 3175 
 3176 
 3177 -- |Sensitivity to change in the underlying forward price.
 3178 deltaForward :: (GenBlackCalculator bc) -> IO ((Double))
 3179 deltaForward a1 =
 3180   withBlackCalculator a1 $ \a1' -> 
 3181   preErrorCheck $ \a2' -> 
 3182   deltaForward'_ a1' a2' >>= \res ->
 3183   let {res' = realToFrac res} in
 3184   errorCheck  a2'>>
 3185   return (res')
 3186 
 3187 
 3188 
 3189 -- |Sensitivity to dividend/growth rate.
 3190 dividendRho :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 3191  -> IO ((Double))
 3192 dividendRho a1 a2 =
 3193   withBlackCalculator a1 $ \a1' -> 
 3194   let {a2' = realToFrac a2} in 
 3195   preErrorCheck $ \a3' -> 
 3196   dividendRho'_ a1' a2' a3' >>= \res ->
 3197   let {res' = realToFrac res} in
 3198   errorCheck  a3'>>
 3199   return (res')
 3200 
 3201 
 3202 
 3203 -- |Sensitivity in percent to a percent change in the underlying spot price.
 3204 blackElasticity :: (GenBlackCalculator bc) -> (Double) -- ^spot
 3205  -> IO ((Double))
 3206 blackElasticity a1 a2 =
 3207   withBlackCalculator a1 $ \a1' -> 
 3208   let {a2' = realToFrac a2} in 
 3209   preErrorCheck $ \a3' -> 
 3210   blackElasticity'_ a1' a2' a3' >>= \res ->
 3211   let {res' = realToFrac res} in
 3212   errorCheck  a3'>>
 3213   return (res')
 3214 
 3215 
 3216 
 3217 -- |Sensitivity in percent to a percent change in the underlying forward price.
 3218 elasticityForward :: (GenBlackCalculator bc) -> IO ((Double))
 3219 elasticityForward a1 =
 3220   withBlackCalculator a1 $ \a1' -> 
 3221   preErrorCheck $ \a2' -> 
 3222   elasticityForward'_ a1' a2' >>= \res ->
 3223   let {res' = realToFrac res} in
 3224   errorCheck  a2'>>
 3225   return (res')
 3226 
 3227 
 3228 
 3229 -- |Second order derivative with respect to change in the underlying spot price.
 3230 blackGamma :: (GenBlackCalculator bc) -> (Double) -- ^spot
 3231  -> IO ((Double))
 3232 blackGamma a1 a2 =
 3233   withBlackCalculator a1 $ \a1' -> 
 3234   let {a2' = realToFrac a2} in 
 3235   preErrorCheck $ \a3' -> 
 3236   blackGamma'_ a1' a2' a3' >>= \res ->
 3237   let {res' = realToFrac res} in
 3238   errorCheck  a3'>>
 3239   return (res')
 3240 
 3241 
 3242 
 3243 -- |Second order derivative with respect to change in the underlying forward price.
 3244 gammaForward :: (GenBlackCalculator bc) -> IO ((Double))
 3245 gammaForward a1 =
 3246   withBlackCalculator a1 $ \a1' -> 
 3247   preErrorCheck $ \a2' -> 
 3248   gammaForward'_ a1' a2' >>= \res ->
 3249   let {res' = realToFrac res} in
 3250   errorCheck  a2'>>
 3251   return (res')
 3252 
 3253 
 3254 
 3255 -- |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.
 3256 itmAssetProbability :: (GenBlackCalculator bc) -> IO ((Double))
 3257 itmAssetProbability a1 =
 3258   withBlackCalculator a1 $ \a1' -> 
 3259   preErrorCheck $ \a2' -> 
 3260   itmAssetProbability'_ a1' a2' >>= \res ->
 3261   let {res' = realToFrac res} in
 3262   errorCheck  a2'>>
 3263   return (res')
 3264 
 3265 
 3266 
 3267 -- |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.
 3268 itmCashProbability :: (GenBlackCalculator bc) -> IO ((Double))
 3269 itmCashProbability a1 =
 3270   withBlackCalculator a1 $ \a1' -> 
 3271   preErrorCheck $ \a2' -> 
 3272   itmCashProbability'_ a1' a2' >>= \res ->
 3273   let {res' = realToFrac res} in
 3274   errorCheck  a2'>>
 3275   return (res')
 3276 
 3277 
 3278 
 3279 -- |Sensitivity to discounting rate.
 3280 rho :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 3281  -> IO ((Double))
 3282 rho a1 a2 =
 3283   withBlackCalculator a1 $ \a1' -> 
 3284   let {a2' = realToFrac a2} in 
 3285   preErrorCheck $ \a3' -> 
 3286   rho'_ a1' a2' a3' >>= \res ->
 3287   let {res' = realToFrac res} in
 3288   errorCheck  a3'>>
 3289   return (res')
 3290 
 3291 
 3292 
 3293 -- |Sensitivity to strike.
 3294 strikeSensitivity :: (GenBlackCalculator bc) -> IO ((Double))
 3295 strikeSensitivity a1 =
 3296   withBlackCalculator a1 $ \a1' -> 
 3297   preErrorCheck $ \a2' -> 
 3298   strikeSensitivity'_ a1' a2' >>= \res ->
 3299   let {res' = realToFrac res} in
 3300   errorCheck  a2'>>
 3301   return (res')
 3302 
 3303 
 3304 
 3305 -- |gamma w.r.t. strike.
 3306 strikeGamma :: (GenBlackCalculator bc) -> IO ((Double))
 3307 strikeGamma a1 =
 3308   withBlackCalculator a1 $ \a1' -> 
 3309   preErrorCheck $ \a2' -> 
 3310   strikeGamma'_ a1' a2' >>= \res ->
 3311   let {res' = realToFrac res} in
 3312   errorCheck  a2'>>
 3313   return (res')
 3314 
 3315 
 3316 
 3317 -- |Sensitivity to time to maturity.
 3318 blackTheta :: (GenBlackCalculator bc) -> (Double) -- ^spot
 3319  -> (Double) -- ^maturity
 3320  -> IO ((Double))
 3321 blackTheta a1 a2 a3 =
 3322   withBlackCalculator a1 $ \a1' -> 
 3323   let {a2' = realToFrac a2} in 
 3324   let {a3' = realToFrac a3} in 
 3325   preErrorCheck $ \a4' -> 
 3326   blackTheta'_ a1' a2' a3' a4' >>= \res ->
 3327   let {res' = realToFrac res} in
 3328   errorCheck  a4'>>
 3329   return (res')
 3330 
 3331 
 3332 
 3333 -- |Sensitivity to time to maturity per day, assuming 365 day per year.
 3334 blackThetaPerDay :: (GenBlackCalculator bc) -> (Double) -- ^spot
 3335  -> (Double) -- ^maturity
 3336  -> IO ((Double))
 3337 blackThetaPerDay a1 a2 a3 =
 3338   withBlackCalculator a1 $ \a1' -> 
 3339   let {a2' = realToFrac a2} in 
 3340   let {a3' = realToFrac a3} in 
 3341   preErrorCheck $ \a4' -> 
 3342   blackThetaPerDay'_ a1' a2' a3' a4' >>= \res ->
 3343   let {res' = realToFrac res} in
 3344   errorCheck  a4'>>
 3345   return (res')
 3346 
 3347 
 3348 
 3349 -- |the option's fair value
 3350 value :: (GenBlackCalculator bc) -> IO ((Double))
 3351 value a1 =
 3352   withBlackCalculator a1 $ \a1' -> 
 3353   preErrorCheck $ \a2' -> 
 3354   value'_ a1' a2' >>= \res ->
 3355   let {res' = realToFrac res} in
 3356   errorCheck  a2'>>
 3357   return (res')
 3358 
 3359 
 3360 
 3361 -- |Sensitivity of vega to spot (Vanna).
 3362 vanna :: (GenBlackCalculator bc) -> (Double) -- ^spot
 3363  -> (Double) -- ^maturity
 3364  -> IO ((Double))
 3365 vanna a1 a2 a3 =
 3366   withBlackCalculator a1 $ \a1' -> 
 3367   let {a2' = realToFrac a2} in 
 3368   let {a3' = realToFrac a3} in 
 3369   preErrorCheck $ \a4' -> 
 3370   vanna'_ a1' a2' a3' a4' >>= \res ->
 3371   let {res' = realToFrac res} in
 3372   errorCheck  a4'>>
 3373   return (res')
 3374 
 3375 
 3376 
 3377 -- |Sensitivity to volatility.
 3378 vega :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 3379  -> IO ((Double))
 3380 vega a1 a2 =
 3381   withBlackCalculator a1 $ \a1' -> 
 3382   let {a2' = realToFrac a2} in 
 3383   preErrorCheck $ \a3' -> 
 3384   vega'_ a1' a2' a3' >>= \res ->
 3385   let {res' = realToFrac res} in
 3386   errorCheck  a3'>>
 3387   return (res')
 3388 
 3389 
 3390 
 3391 -- |Sensitivity of vega to volatility (Volga).
 3392 volga :: (GenBlackCalculator bc) -> (Double) -- ^maturity
 3393  -> IO ((Double))
 3394 volga a1 a2 =
 3395   withBlackCalculator a1 $ \a1' -> 
 3396   let {a2' = realToFrac a2} in 
 3397   preErrorCheck $ \a3' -> 
 3398   volga'_ a1' a2' a3' >>= \res ->
 3399   let {res' = realToFrac res} in
 3400   errorCheck  a3'>>
 3401   return (res')
 3402 
 3403 
 3404 
 3405 -- |Black-Scholes-Merton option-price calculator, from the option type and strike directly
 3406 blackScholesCalculator' :: (OptionType) -> (Double) -- ^strike
 3407  -> (Double) -- ^spot
 3408  -> (Double) -- ^growth
 3409  -> (Double) -- ^stdDev
 3410  -> (Double) -- ^discount
 3411  -> IO ((BlackScholesCalculator))
 3412 blackScholesCalculator' a1 a2 a3 a4 a5 a6 =
 3413   let {a1' = fromEnumC a1} in 
 3414   let {a2' = realToFrac a2} in 
 3415   let {a3' = realToFrac a3} in 
 3416   let {a4' = realToFrac a4} in 
 3417   let {a5' = realToFrac a5} in 
 3418   let {a6' = realToFrac a6} in 
 3419   preErrorCheck $ \a7' -> 
 3420   blackScholesCalculator''_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 3421   peekBlackScholesCalculator res >>= \res' ->
 3422   errorCheck  a7'>>
 3423   return (res')
 3424 
 3425 
 3426 
 3427 -- |Black-Scholes-Merton option-price calculator, from a striked payoff and spot price
 3428 blackScholesCalculator :: (StrikedPayoff) -> (Double) -- ^spot
 3429  -> (Double) -- ^growth
 3430  -> (Double) -- ^stdDev
 3431  -> (Double) -- ^discount
 3432  -> IO ((BlackScholesCalculator))
 3433 blackScholesCalculator a1 a2 a3 a4 a5 =
 3434   withStrikedPayoff a1 $ \a1' -> 
 3435   let {a2' = realToFrac a2} in 
 3436   let {a3' = realToFrac a3} in 
 3437   let {a4' = realToFrac a4} in 
 3438   let {a5' = realToFrac a5} in 
 3439   preErrorCheck $ \a6' -> 
 3440   blackScholesCalculator'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 3441   peekBlackScholesCalculator res >>= \res' ->
 3442   errorCheck  a6'>>
 3443   return (res')
 3444 
 3445 
 3446 
 3447 -- |Sensitivity to change in the underlying spot price.
 3448 blackScholesDelta :: (BlackScholesCalculator) -> IO ((Double))
 3449 blackScholesDelta a1 =
 3450   withGenBlackCalculator a1 $ \a1' -> 
 3451   preErrorCheck $ \a2' -> 
 3452   blackScholesDelta'_ a1' a2' >>= \res ->
 3453   let {res' = realToFrac res} in
 3454   errorCheck  a2'>>
 3455   return (res')
 3456 
 3457 
 3458 
 3459 -- |Sensitivity in percent to a percent change in the underlying spot price.
 3460 blackScholesElasticity :: (BlackScholesCalculator) -> IO ((Double))
 3461 blackScholesElasticity a1 =
 3462   withGenBlackCalculator a1 $ \a1' -> 
 3463   preErrorCheck $ \a2' -> 
 3464   blackScholesElasticity'_ a1' a2' >>= \res ->
 3465   let {res' = realToFrac res} in
 3466   errorCheck  a2'>>
 3467   return (res')
 3468 
 3469 
 3470 
 3471 -- |Second order derivative with respect to change in the underlying spot price.
 3472 blackScholesGamma :: (BlackScholesCalculator) -> IO ((Double))
 3473 blackScholesGamma a1 =
 3474   withGenBlackCalculator a1 $ \a1' -> 
 3475   preErrorCheck $ \a2' -> 
 3476   blackScholesGamma'_ a1' a2' >>= \res ->
 3477   let {res' = realToFrac res} in
 3478   errorCheck  a2'>>
 3479   return (res')
 3480 
 3481 
 3482 
 3483 -- |Sensitivity to time to maturity.
 3484 blackScholesTheta :: (BlackScholesCalculator) -> (Double) -- ^maturity
 3485  -> IO ((Double))
 3486 blackScholesTheta a1 a2 =
 3487   withGenBlackCalculator a1 $ \a1' -> 
 3488   let {a2' = realToFrac a2} in 
 3489   preErrorCheck $ \a3' -> 
 3490   blackScholesTheta'_ a1' a2' a3' >>= \res ->
 3491   let {res' = realToFrac res} in
 3492   errorCheck  a3'>>
 3493   return (res')
 3494 
 3495 
 3496 
 3497 -- |Sensitivity to time to maturity per day (assuming 365 day in a year).
 3498 blackScholesThetaPerDay :: (BlackScholesCalculator) -> (Double) -- ^maturity
 3499  -> IO ((Double))
 3500 blackScholesThetaPerDay a1 a2 =
 3501   withGenBlackCalculator a1 $ \a1' -> 
 3502   let {a2' = realToFrac a2} in 
 3503   preErrorCheck $ \a3' -> 
 3504   blackScholesThetaPerDay'_ a1' a2' a3' >>= \res ->
 3505   let {res' = realToFrac res} in
 3506   errorCheck  a3'>>
 3507   return (res')
 3508 
 3509 
 3510 
 3511 -- |Bachelier (normal-model) analogue of 'BlackCalculator', for options on a rate rather than a
 3512 -- price. No subclass hierarchy upstream, unlike BlackCalculator\/BlackScholesCalculator, so this
 3513 -- is a single leaf type with its own methods rather than a 'GenBlackCalculator' instance.
 3514 bachelierCalculator' :: (OptionType) -> (Double) -- ^strike
 3515  -> (Double) -- ^forward
 3516  -> (Double) -- ^stdDev
 3517  -> (Double) -- ^discount
 3518  -> IO ((BachelierCalculator))
 3519 bachelierCalculator' a1 a2 a3 a4 a5 =
 3520   let {a1' = fromEnumC a1} in 
 3521   let {a2' = realToFrac a2} in 
 3522   let {a3' = realToFrac a3} in 
 3523   let {a4' = realToFrac a4} in 
 3524   let {a5' = realToFrac a5} in 
 3525   preErrorCheck $ \a6' -> 
 3526   bachelierCalculator''_ a1' a2' a3' a4' a5' a6' >>= \res ->
 3527   peekBachelierCalculator res >>= \res' ->
 3528   errorCheck  a6'>>
 3529   return (res')
 3530 
 3531 
 3532 
 3533 -- |Bachelier (normal-model) option-price calculator, from a striked payoff
 3534 bachelierCalculator :: (StrikedPayoff) -> (Double) -- ^forward
 3535  -> (Double) -- ^stdDev
 3536  -> (Double) -- ^discount
 3537  -> IO ((BachelierCalculator))
 3538 bachelierCalculator a1 a2 a3 a4 =
 3539   withStrikedPayoff a1 $ \a1' -> 
 3540   let {a2' = realToFrac a2} in 
 3541   let {a3' = realToFrac a3} in 
 3542   let {a4' = realToFrac a4} in 
 3543   preErrorCheck $ \a5' -> 
 3544   bachelierCalculator'_ a1' a2' a3' a4' a5' >>= \res ->
 3545   peekBachelierCalculator res >>= \res' ->
 3546   errorCheck  a5'>>
 3547   return (res')
 3548 
 3549 
 3550 
 3551 -- |intermediate value used internally to derive the calculator's Greeks
 3552 bachelierAlpha :: (BachelierCalculator) -> IO ((Double))
 3553 bachelierAlpha a1 =
 3554   withBachelierCalculator a1 $ \a1' -> 
 3555   preErrorCheck $ \a2' -> 
 3556   bachelierAlpha'_ a1' a2' >>= \res ->
 3557   let {res' = realToFrac res} in
 3558   errorCheck  a2'>>
 3559   return (res')
 3560 
 3561 
 3562 
 3563 -- |intermediate value used internally to derive the calculator's Greeks
 3564 bachelierBeta :: (BachelierCalculator) -> IO ((Double))
 3565 bachelierBeta a1 =
 3566   withBachelierCalculator a1 $ \a1' -> 
 3567   preErrorCheck $ \a2' -> 
 3568   bachelierBeta'_ a1' a2' >>= \res ->
 3569   let {res' = realToFrac res} in
 3570   errorCheck  a2'>>
 3571   return (res')
 3572 
 3573 
 3574 
 3575 -- |Sensitivity to change in the underlying spot price.
 3576 bachelierDelta :: (BachelierCalculator) -> (Double) -- ^spot
 3577  -> IO ((Double))
 3578 bachelierDelta a1 a2 =
 3579   withBachelierCalculator a1 $ \a1' -> 
 3580   let {a2' = realToFrac a2} in 
 3581   preErrorCheck $ \a3' -> 
 3582   bachelierDelta'_ a1' a2' a3' >>= \res ->
 3583   let {res' = realToFrac res} in
 3584   errorCheck  a3'>>
 3585   return (res')
 3586 
 3587 
 3588 
 3589 -- |Sensitivity to change in the underlying forward price.
 3590 bachelierDeltaForward :: (BachelierCalculator) -> IO ((Double))
 3591 bachelierDeltaForward a1 =
 3592   withBachelierCalculator a1 $ \a1' -> 
 3593   preErrorCheck $ \a2' -> 
 3594   bachelierDeltaForward'_ a1' a2' >>= \res ->
 3595   let {res' = realToFrac res} in
 3596   errorCheck  a2'>>
 3597   return (res')
 3598 
 3599 
 3600 
 3601 -- |Sensitivity to dividend/growth rate.
 3602 bachelierDividendRho :: (BachelierCalculator) -> (Double) -- ^maturity
 3603  -> IO ((Double))
 3604 bachelierDividendRho a1 a2 =
 3605   withBachelierCalculator a1 $ \a1' -> 
 3606   let {a2' = realToFrac a2} in 
 3607   preErrorCheck $ \a3' -> 
 3608   bachelierDividendRho'_ a1' a2' a3' >>= \res ->
 3609   let {res' = realToFrac res} in
 3610   errorCheck  a3'>>
 3611   return (res')
 3612 
 3613 
 3614 
 3615 -- |Sensitivity in percent to a percent change in the underlying spot price.
 3616 bachelierElasticity :: (BachelierCalculator) -> (Double) -- ^spot
 3617  -> IO ((Double))
 3618 bachelierElasticity a1 a2 =
 3619   withBachelierCalculator a1 $ \a1' -> 
 3620   let {a2' = realToFrac a2} in 
 3621   preErrorCheck $ \a3' -> 
 3622   bachelierElasticity'_ a1' a2' a3' >>= \res ->
 3623   let {res' = realToFrac res} in
 3624   errorCheck  a3'>>
 3625   return (res')
 3626 
 3627 
 3628 
 3629 -- |Sensitivity in percent to a percent change in the underlying forward price.
 3630 bachelierElasticityForward :: (BachelierCalculator) -> IO ((Double))
 3631 bachelierElasticityForward a1 =
 3632   withBachelierCalculator a1 $ \a1' -> 
 3633   preErrorCheck $ \a2' -> 
 3634   bachelierElasticityForward'_ a1' a2' >>= \res ->
 3635   let {res' = realToFrac res} in
 3636   errorCheck  a2'>>
 3637   return (res')
 3638 
 3639 
 3640 
 3641 -- |Second order derivative with respect to change in the underlying spot price.
 3642 bachelierGamma :: (BachelierCalculator) -> (Double) -- ^spot
 3643  -> IO ((Double))
 3644 bachelierGamma a1 a2 =
 3645   withBachelierCalculator a1 $ \a1' -> 
 3646   let {a2' = realToFrac a2} in 
 3647   preErrorCheck $ \a3' -> 
 3648   bachelierGamma'_ a1' a2' a3' >>= \res ->
 3649   let {res' = realToFrac res} in
 3650   errorCheck  a3'>>
 3651   return (res')
 3652 
 3653 
 3654 
 3655 -- |Second order derivative with respect to change in the underlying forward price.
 3656 bachelierGammaForward :: (BachelierCalculator) -> IO ((Double))
 3657 bachelierGammaForward a1 =
 3658   withBachelierCalculator a1 $ \a1' -> 
 3659   preErrorCheck $ \a2' -> 
 3660   bachelierGammaForward'_ a1' a2' >>= \res ->
 3661   let {res' = realToFrac res} in
 3662   errorCheck  a2'>>
 3663   return (res')
 3664 
 3665 
 3666 
 3667 -- |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.
 3668 bachelierItmAssetProbability :: (BachelierCalculator) -> IO ((Double))
 3669 bachelierItmAssetProbability a1 =
 3670   withBachelierCalculator a1 $ \a1' -> 
 3671   preErrorCheck $ \a2' -> 
 3672   bachelierItmAssetProbability'_ a1' a2' >>= \res ->
 3673   let {res' = realToFrac res} in
 3674   errorCheck  a2'>>
 3675   return (res')
 3676 
 3677 
 3678 
 3679 -- |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.
 3680 bachelierItmCashProbability :: (BachelierCalculator) -> IO ((Double))
 3681 bachelierItmCashProbability a1 =
 3682   withBachelierCalculator a1 $ \a1' -> 
 3683   preErrorCheck $ \a2' -> 
 3684   bachelierItmCashProbability'_ a1' a2' >>= \res ->
 3685   let {res' = realToFrac res} in
 3686   errorCheck  a2'>>
 3687   return (res')
 3688 
 3689 
 3690 
 3691 -- |Sensitivity to discounting rate.
 3692 bachelierRho :: (BachelierCalculator) -> (Double) -- ^maturity
 3693  -> IO ((Double))
 3694 bachelierRho a1 a2 =
 3695   withBachelierCalculator a1 $ \a1' -> 
 3696   let {a2' = realToFrac a2} in 
 3697   preErrorCheck $ \a3' -> 
 3698   bachelierRho'_ a1' a2' a3' >>= \res ->
 3699   let {res' = realToFrac res} in
 3700   errorCheck  a3'>>
 3701   return (res')
 3702 
 3703 
 3704 
 3705 -- |Sensitivity to strike.
 3706 bachelierStrikeSensitivity :: (BachelierCalculator) -> IO ((Double))
 3707 bachelierStrikeSensitivity a1 =
 3708   withBachelierCalculator a1 $ \a1' -> 
 3709   preErrorCheck $ \a2' -> 
 3710   bachelierStrikeSensitivity'_ a1' a2' >>= \res ->
 3711   let {res' = realToFrac res} in
 3712   errorCheck  a2'>>
 3713   return (res')
 3714 
 3715 
 3716 
 3717 -- |gamma w.r.t. strike.
 3718 bachelierStrikeGamma :: (BachelierCalculator) -> IO ((Double))
 3719 bachelierStrikeGamma a1 =
 3720   withBachelierCalculator a1 $ \a1' -> 
 3721   preErrorCheck $ \a2' -> 
 3722   bachelierStrikeGamma'_ a1' a2' >>= \res ->
 3723   let {res' = realToFrac res} in
 3724   errorCheck  a2'>>
 3725   return (res')
 3726 
 3727 
 3728 
 3729 -- |Sensitivity to time to maturity.
 3730 bachelierTheta :: (BachelierCalculator) -> (Double) -- ^spot
 3731  -> (Double) -- ^maturity
 3732  -> IO ((Double))
 3733 bachelierTheta a1 a2 a3 =
 3734   withBachelierCalculator a1 $ \a1' -> 
 3735   let {a2' = realToFrac a2} in 
 3736   let {a3' = realToFrac a3} in 
 3737   preErrorCheck $ \a4' -> 
 3738   bachelierTheta'_ a1' a2' a3' a4' >>= \res ->
 3739   let {res' = realToFrac res} in
 3740   errorCheck  a4'>>
 3741   return (res')
 3742 
 3743 
 3744 
 3745 -- |Sensitivity to time to maturity per day, assuming 365 day per year.
 3746 bachelierThetaPerDay :: (BachelierCalculator) -> (Double) -- ^spot
 3747  -> (Double) -- ^maturity
 3748  -> IO ((Double))
 3749 bachelierThetaPerDay a1 a2 a3 =
 3750   withBachelierCalculator a1 $ \a1' -> 
 3751   let {a2' = realToFrac a2} in 
 3752   let {a3' = realToFrac a3} in 
 3753   preErrorCheck $ \a4' -> 
 3754   bachelierThetaPerDay'_ a1' a2' a3' a4' >>= \res ->
 3755   let {res' = realToFrac res} in
 3756   errorCheck  a4'>>
 3757   return (res')
 3758 
 3759 
 3760 
 3761 -- |the option's fair value
 3762 bachelierValue :: (BachelierCalculator) -> IO ((Double))
 3763 bachelierValue a1 =
 3764   withBachelierCalculator a1 $ \a1' -> 
 3765   preErrorCheck $ \a2' -> 
 3766   bachelierValue'_ a1' a2' >>= \res ->
 3767   let {res' = realToFrac res} in
 3768   errorCheck  a2'>>
 3769   return (res')
 3770 
 3771 
 3772 
 3773 -- |Sensitivity of vega to spot (Vanna).
 3774 bachelierVanna :: (BachelierCalculator) -> (Double) -- ^maturity
 3775  -> IO ((Double))
 3776 bachelierVanna a1 a2 =
 3777   withBachelierCalculator a1 $ \a1' -> 
 3778   let {a2' = realToFrac a2} in 
 3779   preErrorCheck $ \a3' -> 
 3780   bachelierVanna'_ a1' a2' a3' >>= \res ->
 3781   let {res' = realToFrac res} in
 3782   errorCheck  a3'>>
 3783   return (res')
 3784 
 3785 
 3786 
 3787 -- |Sensitivity to volatility.
 3788 bachelierVega :: (BachelierCalculator) -> (Double) -- ^maturity
 3789  -> IO ((Double))
 3790 bachelierVega a1 a2 =
 3791   withBachelierCalculator a1 $ \a1' -> 
 3792   let {a2' = realToFrac a2} in 
 3793   preErrorCheck $ \a3' -> 
 3794   bachelierVega'_ a1' a2' a3' >>= \res ->
 3795   let {res' = realToFrac res} in
 3796   errorCheck  a3'>>
 3797   return (res')
 3798 
 3799 
 3800 
 3801 -- |Sensitivity of vega to volatility (Volga).
 3802 bachelierVolga :: (BachelierCalculator) -> (Double) -- ^maturity
 3803  -> IO ((Double))
 3804 bachelierVolga a1 a2 =
 3805   withBachelierCalculator a1 $ \a1' -> 
 3806   let {a2' = realToFrac a2} in 
 3807   preErrorCheck $ \a3' -> 
 3808   bachelierVolga'_ a1' a2' a3' >>= \res ->
 3809   let {res' = realToFrac res} in
 3810   errorCheck  a3'>>
 3811   return (res')
 3812 
 3813 
 3814 
 3815 -- |computes the strike given the option's Black-Scholes delta (in an FX-style delta/vol quotation)
 3816 blackDeltaCalculator :: (OptionType) -> (DeltaType) -> (Double) -- ^spot
 3817  -> (Double) -- ^dDiscount (domestic discount factor)
 3818  -> (Double) -- ^fDiscount (foreign discount factor)
 3819  -> (Double) -- ^stdDev
 3820  -> IO ((BlackDeltaCalculator))
 3821 blackDeltaCalculator a1 a2 a3 a4 a5 a6 =
 3822   let {a1' = fromEnumC a1} in 
 3823   let {a2' = fromEnumC a2} in 
 3824   let {a3' = realToFrac a3} in 
 3825   let {a4' = realToFrac a4} in 
 3826   let {a5' = realToFrac a5} in 
 3827   let {a6' = realToFrac a6} in 
 3828   preErrorCheck $ \a7' -> 
 3829   blackDeltaCalculator'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 3830   peekBlackDeltaCalculator res >>= \res' ->
 3831   errorCheck  a7'>>
 3832   return (res')
 3833 
 3834 
 3835 
 3836 -- |the option delta under the calculator's chosen convention, for the given strike
 3837 deltaFromStrike :: (BlackDeltaCalculator) -> (Double) -- ^strike
 3838  -> IO ((Double))
 3839 deltaFromStrike a1 a2 =
 3840   withBlackDeltaCalculator a1 $ \a1' -> 
 3841   let {a2' = realToFrac a2} in 
 3842   preErrorCheck $ \a3' -> 
 3843   deltaFromStrike'_ a1' a2' a3' >>= \res ->
 3844   let {res' = realToFrac res} in
 3845   errorCheck  a3'>>
 3846   return (res')
 3847 
 3848 
 3849 
 3850 -- |the strike price corresponding to the given option delta (under the calculator's chosen convention)
 3851 strikeFromDelta :: (BlackDeltaCalculator) -> (Double) -- ^delta
 3852  -> IO ((Double))
 3853 strikeFromDelta a1 a2 =
 3854   withBlackDeltaCalculator a1 $ \a1' -> 
 3855   let {a2' = realToFrac a2} in 
 3856   preErrorCheck $ \a3' -> 
 3857   strikeFromDelta'_ a1' a2' a3' >>= \res ->
 3858   let {res' = realToFrac res} in
 3859   errorCheck  a3'>>
 3860   return (res')
 3861 
 3862 
 3863 
 3864 -- |the at-the-money strike under the given ATM convention, independent of the strike passed at construction
 3865 atmStrike :: (BlackDeltaCalculator) -> (AtmType) -> IO ((Double))
 3866 atmStrike a1 a2 =
 3867   withBlackDeltaCalculator a1 $ \a1' -> 
 3868   let {a2' = fromEnumC a2} in 
 3869   preErrorCheck $ \a3' -> 
 3870   atmStrike'_ a1' a2' a3' >>= \res ->
 3871   let {res' = realToFrac res} in
 3872   errorCheck  a3'>>
 3873   return (res')
 3874 
 3875 
 3876 
 3877 -- |Black 1976 formula /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)
 3878 blackFormula' :: (PlainVanillaPayoff) -> (Double) -- ^forward
 3879  -> (Double) -- ^stdDev
 3880  -> (Double) -- ^discount
 3881  -> (Double) -- ^displacement
 3882  -> IO ((Double))
 3883 blackFormula' a1 a2 a3 a4 a5 =
 3884   withPlainVanillaPayoff a1 $ \a1' -> 
 3885   let {a2' = realToFrac a2} in 
 3886   let {a3' = realToFrac a3} in 
 3887   let {a4' = realToFrac a4} in 
 3888   let {a5' = realToFrac a5} in 
 3889   preErrorCheck $ \a6' -> 
 3890   blackFormula''_ a1' a2' a3' a4' a5' a6' >>= \res ->
 3891   let {res' = realToFrac res} in
 3892   errorCheck  a6'>>
 3893   return (res')
 3894 
 3895 
 3896 
 3897 -- |Black 1976 formula /Warning/ instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)
 3898 blackFormula :: (OptionType) -> (Double) -- ^strike
 3899  -> (Double) -- ^forward
 3900  -> (Double) -- ^stdDev
 3901  -> (Double) -- ^discount
 3902  -> (Double) -- ^displacement
 3903  -> IO ((Double))
 3904 blackFormula a1 a2 a3 a4 a5 a6 =
 3905   let {a1' = fromEnumC a1} in 
 3906   let {a2' = realToFrac a2} in 
 3907   let {a3' = realToFrac a3} in 
 3908   let {a4' = realToFrac a4} in 
 3909   let {a5' = realToFrac a5} in 
 3910   let {a6' = realToFrac a6} in 
 3911   preErrorCheck $ \a7' -> 
 3912   blackFormula'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 3913   let {res' = realToFrac res} in
 3914   errorCheck  a7'>>
 3915   return (res')
 3916 
 3917 
 3918 
 3919 
 3920 -- |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)
 3921 blackCashItmProbability' :: (PlainVanillaPayoff) -> (Double) -- ^forward
 3922  -> (Double) -- ^stdDev
 3923  -> (Double) -- ^displacement
 3924  -> IO ((Double))
 3925 blackCashItmProbability' a1 a2 a3 a4 =
 3926   withPlainVanillaPayoff a1 $ \a1' -> 
 3927   let {a2' = realToFrac a2} in 
 3928   let {a3' = realToFrac a3} in 
 3929   let {a4' = realToFrac a4} in 
 3930   preErrorCheck $ \a5' -> 
 3931   blackCashItmProbability''_ a1' a2' a3' a4' a5' >>= \res ->
 3932   let {res' = realToFrac res} in
 3933   errorCheck  a5'>>
 3934   return (res')
 3935 
 3936 
 3937 
 3938 -- |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)
 3939 blackCashItmProbability :: (OptionType) -> (Double) -> (Double) -- ^forward
 3940  -> (Double) -- ^stdDev
 3941  -> (Double) -- ^displacement
 3942  -> IO ((Double))
 3943 blackCashItmProbability a1 a2 a3 a4 a5 =
 3944   let {a1' = fromEnumC a1} in 
 3945   let {a2' = realToFrac a2} in 
 3946   let {a3' = realToFrac a3} in 
 3947   let {a4' = realToFrac a4} in 
 3948   let {a5' = realToFrac a5} in 
 3949   preErrorCheck $ \a6' -> 
 3950   blackCashItmProbability'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 3951   let {res' = realToFrac res} in
 3952   errorCheck  a6'>>
 3953   return (res')
 3954 
 3955 
 3956 
 3957 -- |Black 1976 implied standard deviation, i.e. volatility*sqrt(timeToMaturity)
 3958 blackImpliedStdDev' :: (PlainVanillaPayoff) -> (Double) -- ^forward
 3959  -> (Double) -- ^blackPrice
 3960  -> (Double) -- ^discount
 3961  -> (Double) -- ^displacement
 3962  -> (Double) -- ^guess
 3963  -> (Double) -- ^accuracy
 3964  -> (Word) -- ^maxIterations
 3965  -> IO ((Double))
 3966 blackImpliedStdDev' a1 a2 a3 a4 a5 a6 a7 a8 =
 3967   withPlainVanillaPayoff a1 $ \a1' -> 
 3968   let {a2' = realToFrac a2} in 
 3969   let {a3' = realToFrac a3} in 
 3970   let {a4' = realToFrac a4} in 
 3971   let {a5' = realToFrac a5} in 
 3972   let {a6' = realToFrac a6} in 
 3973   let {a7' = realToFrac a7} in 
 3974   let {a8' = fromIntegral a8} in 
 3975   preErrorCheck $ \a9' -> 
 3976   blackImpliedStdDev''_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 3977   let {res' = realToFrac res} in
 3978   errorCheck  a9'>>
 3979   return (res')
 3980 
 3981 
 3982 
 3983 -- |Black 1976 implied standard deviation, i.e. volatility*sqrt(timeToMaturity)
 3984 blackImpliedStdDev :: (OptionType) -> (Double) -- ^strike
 3985  -> (Double) -- ^forward
 3986  -> (Double) -- ^blackPrice
 3987  -> (Double) -- ^discount
 3988  -> (Double) -- ^displacement
 3989  -> (Double) -- ^guess
 3990  -> (Double) -- ^accuracy
 3991  -> (Word) -- ^maxIterations
 3992  -> IO ((Double))
 3993 blackImpliedStdDev a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 3994   let {a1' = fromEnumC a1} in 
 3995   let {a2' = realToFrac a2} in 
 3996   let {a3' = realToFrac a3} in 
 3997   let {a4' = realToFrac a4} in 
 3998   let {a5' = realToFrac a5} in 
 3999   let {a6' = realToFrac a6} in 
 4000   let {a7' = realToFrac a7} in 
 4001   let {a8' = realToFrac a8} in 
 4002   let {a9' = fromIntegral a9} in 
 4003   preErrorCheck $ \a10' -> 
 4004   blackImpliedStdDev'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 4005   let {res' = realToFrac res} in
 4006   errorCheck  a10'>>
 4007   return (res')
 4008 
 4009 
 4010 
 4011 -- |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)
 4012 blackImpliedStdDevApproximation' :: (PlainVanillaPayoff) -> (Double) -- ^forward
 4013  -> (Double) -- ^blackPrice
 4014  -> (Double) -- ^discount
 4015  -> (Double) -- ^displacement
 4016  -> IO ((Double))
 4017 blackImpliedStdDevApproximation' a1 a2 a3 a4 a5 =
 4018   withPlainVanillaPayoff a1 $ \a1' -> 
 4019   let {a2' = realToFrac a2} in 
 4020   let {a3' = realToFrac a3} in 
 4021   let {a4' = realToFrac a4} in 
 4022   let {a5' = realToFrac a5} in 
 4023   preErrorCheck $ \a6' -> 
 4024   blackImpliedStdDevApproximation''_ a1' a2' a3' a4' a5' a6' >>= \res ->
 4025   let {res' = realToFrac res} in
 4026   errorCheck  a6'>>
 4027   return (res')
 4028 
 4029 
 4030 
 4031 -- |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)
 4032 blackImpliedStdDevApproximation :: (OptionType) -> (Double) -- ^strike
 4033  -> (Double) -- ^forward
 4034  -> (Double) -- ^blackPrice
 4035  -> (Double) -- ^discount
 4036  -> (Double) -- ^displacement
 4037  -> IO ((Double))
 4038 blackImpliedStdDevApproximation a1 a2 a3 a4 a5 a6 =
 4039   let {a1' = fromEnumC a1} in 
 4040   let {a2' = realToFrac a2} in 
 4041   let {a3' = realToFrac a3} in 
 4042   let {a4' = realToFrac a4} in 
 4043   let {a5' = realToFrac a5} in 
 4044   let {a6' = realToFrac a6} in 
 4045   preErrorCheck $ \a7' -> 
 4046   blackImpliedStdDevApproximation'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 4047   let {res' = realToFrac res} in
 4048   errorCheck  a7'>>
 4049   return (res')
 4050 
 4051 
 4052 
 4053 -- |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)
 4054 blackStdDevDerivative' :: (PlainVanillaPayoff) -> (Double) -- ^forward
 4055  -> (Double) -- ^blackPrice
 4056  -> (Double) -- ^discount
 4057  -> (Double) -- ^displacement
 4058  -> IO ((Double))
 4059 blackStdDevDerivative' a1 a2 a3 a4 a5 =
 4060   withPlainVanillaPayoff a1 $ \a1' -> 
 4061   let {a2' = realToFrac a2} in 
 4062   let {a3' = realToFrac a3} in 
 4063   let {a4' = realToFrac a4} in 
 4064   let {a5' = realToFrac a5} in 
 4065   preErrorCheck $ \a6' -> 
 4066   blackStdDevDerivative''_ a1' a2' a3' a4' a5' a6' >>= \res ->
 4067   let {res' = realToFrac res} in
 4068   errorCheck  a6'>>
 4069   return (res')
 4070 
 4071 
 4072 
 4073 -- |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)
 4074 blackStdDevDerivative :: (Double) -- ^strike
 4075  -> (Double) -- ^forward
 4076  -> (Double) -- ^blackPrice
 4077  -> (Double) -- ^discount
 4078  -> (Double) -- ^displacement
 4079  -> IO ((Double))
 4080 blackStdDevDerivative a1 a2 a3 a4 a5 =
 4081   let {a1' = realToFrac a1} in 
 4082   let {a2' = realToFrac a2} in 
 4083   let {a3' = realToFrac a3} in 
 4084   let {a4' = realToFrac a4} in 
 4085   let {a5' = realToFrac a5} in 
 4086   preErrorCheck $ \a6' -> 
 4087   blackStdDevDerivative'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 4088   let {res' = realToFrac res} in
 4089   errorCheck  a6'>>
 4090   return (res')
 4091 
 4092 
 4093 
 4094 -- |Black 1976 formula for derivative with respect to implied vol, this is basically the vega, but if you want 1% change multiply by 1%
 4095 blackVolDerivative :: (Double) -> (Double) -- ^strike
 4096  -> (Double) -- ^forward
 4097  -> (Double) -- ^blackPrice
 4098  -> (Double) -- ^discount
 4099  -> (Double) -- ^displacement
 4100  -> IO ((Double))
 4101 blackVolDerivative a1 a2 a3 a4 a5 a6 =
 4102   let {a1' = realToFrac a1} in 
 4103   let {a2' = realToFrac a2} in 
 4104   let {a3' = realToFrac a3} in 
 4105   let {a4' = realToFrac a4} in 
 4106   let {a5' = realToFrac a5} in 
 4107   let {a6' = realToFrac a6} in 
 4108   preErrorCheck $ \a7' -> 
 4109   blackVolDerivative'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
 4110   let {res' = realToFrac res} in
 4111   errorCheck  a7'>>
 4112   return (res')
 4113 
 4114 
 4115 
 4116 -- |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)
 4117 bachelierBlackFormula' :: (PlainVanillaPayoff) -> (Double) -- ^forward
 4118  -> (Double) -- ^stdDev
 4119  -> (Double) -- ^discount
 4120  -> IO ((Double))
 4121 bachelierBlackFormula' a1 a2 a3 a4 =
 4122   withPlainVanillaPayoff a1 $ \a1' -> 
 4123   let {a2' = realToFrac a2} in 
 4124   let {a3' = realToFrac a3} in 
 4125   let {a4' = realToFrac a4} in 
 4126   preErrorCheck $ \a5' -> 
 4127   bachelierBlackFormula''_ a1' a2' a3' a4' a5' >>= \res ->
 4128   let {res' = realToFrac res} in
 4129   errorCheck  a5'>>
 4130   return (res')
 4131 
 4132 
 4133 
 4134 -- |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)
 4135 bachelierBlackFormula :: (OptionType) -> (Double) -- ^strike
 4136  -> (Double) -- ^forward
 4137  -> (Double) -- ^stdDev
 4138  -> (Double) -- ^discount
 4139  -> IO ((Double))
 4140 bachelierBlackFormula a1 a2 a3 a4 a5 =
 4141   let {a1' = fromEnumC a1} in 
 4142   let {a2' = realToFrac a2} in 
 4143   let {a3' = realToFrac a3} in 
 4144   let {a4' = realToFrac a4} in 
 4145   let {a5' = realToFrac a5} in 
 4146   preErrorCheck $ \a6' -> 
 4147   bachelierBlackFormula'_ a1' a2' a3' a4' a5' a6' >>= \res ->
 4148   let {res' = realToFrac res} in
 4149   errorCheck  a6'>>
 4150   return (res')
 4151 
 4152 
 4153 
 4154 -- |default theta-per-day calculation
 4155 defaultThetaPerDay :: (Double) -- ^theta
 4156  -> IO ((Double))
 4157 defaultThetaPerDay a1 =
 4158   let {a1' = realToFrac a1} in 
 4159   preErrorCheck $ \a2' -> 
 4160   defaultThetaPerDay'_ a1' a2' >>= \res ->
 4161   let {res' = realToFrac res} in
 4162   errorCheck  a2'>>
 4163   return (res')
 4164 
 4165 
 4166 
 4167 -- |lognormal SABR volatility, no validity checks on the parameters
 4168 unsafeSabrLogNormalVolatility :: (Double) -- ^strike
 4169  -> (Double) -- ^forward
 4170  -> (Double) -- ^expiryTime
 4171  -> (Double) -- ^alpha
 4172  -> (Double) -- ^beta
 4173  -> (Double) -- ^nu
 4174  -> (Double) -- ^rho
 4175  -> IO ((Double))
 4176 unsafeSabrLogNormalVolatility a1 a2 a3 a4 a5 a6 a7 =
 4177   let {a1' = realToFrac a1} in 
 4178   let {a2' = realToFrac a2} in 
 4179   let {a3' = realToFrac a3} in 
 4180   let {a4' = realToFrac a4} in 
 4181   let {a5' = realToFrac a5} in 
 4182   let {a6' = realToFrac a6} in 
 4183   let {a7' = realToFrac a7} in 
 4184   preErrorCheck $ \a8' -> 
 4185   unsafeSabrLogNormalVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 4186   let {res' = realToFrac res} in
 4187   errorCheck  a8'>>
 4188   return (res')
 4189 
 4190 
 4191 
 4192 -- |shifted SABR volatility (lognormal or normal), no validity checks on the parameters
 4193 unsafeShiftedSabrVolatility :: (Double) -- ^strike
 4194  -> (Double) -- ^forward
 4195  -> (Double) -- ^expiryTime
 4196  -> (Double) -- ^alpha
 4197  -> (Double) -- ^beta
 4198  -> (Double) -- ^nu
 4199  -> (Double) -- ^rho
 4200  -> (Double) -- ^shift
 4201  -> (VolatilityType) -- ^volatilityType
 4202  -> IO ((Double))
 4203 unsafeShiftedSabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 4204   let {a1' = realToFrac a1} in 
 4205   let {a2' = realToFrac a2} in 
 4206   let {a3' = realToFrac a3} in 
 4207   let {a4' = realToFrac a4} in 
 4208   let {a5' = realToFrac a5} in 
 4209   let {a6' = realToFrac a6} in 
 4210   let {a7' = realToFrac a7} in 
 4211   let {a8' = realToFrac a8} in 
 4212   let {a9' = (fromIntegral . fromEnum) a9} in 
 4213   preErrorCheck $ \a10' -> 
 4214   unsafeShiftedSabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 4215   let {res' = realToFrac res} in
 4216   errorCheck  a10'>>
 4217   return (res')
 4218 
 4219 
 4220 
 4221 -- |normal SABR volatility, no validity checks on the parameters
 4222 unsafeSabrNormalVolatility :: (Double) -- ^strike
 4223  -> (Double) -- ^forward
 4224  -> (Double) -- ^expiryTime
 4225  -> (Double) -- ^alpha
 4226  -> (Double) -- ^beta
 4227  -> (Double) -- ^nu
 4228  -> (Double) -- ^rho
 4229  -> IO ((Double))
 4230 unsafeSabrNormalVolatility a1 a2 a3 a4 a5 a6 a7 =
 4231   let {a1' = realToFrac a1} in 
 4232   let {a2' = realToFrac a2} in 
 4233   let {a3' = realToFrac a3} in 
 4234   let {a4' = realToFrac a4} in 
 4235   let {a5' = realToFrac a5} in 
 4236   let {a6' = realToFrac a6} in 
 4237   let {a7' = realToFrac a7} in 
 4238   preErrorCheck $ \a8' -> 
 4239   unsafeSabrNormalVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 4240   let {res' = realToFrac res} in
 4241   errorCheck  a8'>>
 4242   return (res')
 4243 
 4244 
 4245 
 4246 -- |SABR volatility (lognormal or normal), no validity checks on the parameters
 4247 unsafeSabrVolatility :: (Double) -- ^strike
 4248  -> (Double) -- ^forward
 4249  -> (Double) -- ^expiryTime
 4250  -> (Double) -- ^alpha
 4251  -> (Double) -- ^beta
 4252  -> (Double) -- ^nu
 4253  -> (Double) -- ^rho
 4254  -> (VolatilityType) -- ^volatilityType
 4255  -> IO ((Double))
 4256 unsafeSabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 =
 4257   let {a1' = realToFrac a1} in 
 4258   let {a2' = realToFrac a2} in 
 4259   let {a3' = realToFrac a3} in 
 4260   let {a4' = realToFrac a4} in 
 4261   let {a5' = realToFrac a5} in 
 4262   let {a6' = realToFrac a6} in 
 4263   let {a7' = realToFrac a7} in 
 4264   let {a8' = (fromIntegral . fromEnum) a8} in 
 4265   preErrorCheck $ \a9' -> 
 4266   unsafeSabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 4267   let {res' = realToFrac res} in
 4268   errorCheck  a9'>>
 4269   return (res')
 4270 
 4271 
 4272 
 4273 -- |SABR volatility (lognormal or normal), with validity checks on the parameters
 4274 sabrVolatility :: (Double) -- ^strike
 4275  -> (Double) -- ^forward
 4276  -> (Double) -- ^expiryTime
 4277  -> (Double) -- ^alpha
 4278  -> (Double) -- ^beta
 4279  -> (Double) -- ^nu
 4280  -> (Double) -- ^rho
 4281  -> (VolatilityType) -- ^volatilityType
 4282  -> IO ((Double))
 4283 sabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 =
 4284   let {a1' = realToFrac a1} in 
 4285   let {a2' = realToFrac a2} in 
 4286   let {a3' = realToFrac a3} in 
 4287   let {a4' = realToFrac a4} in 
 4288   let {a5' = realToFrac a5} in 
 4289   let {a6' = realToFrac a6} in 
 4290   let {a7' = realToFrac a7} in 
 4291   let {a8' = (fromIntegral . fromEnum) a8} in 
 4292   preErrorCheck $ \a9' -> 
 4293   sabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
 4294   let {res' = realToFrac res} in
 4295   errorCheck  a9'>>
 4296   return (res')
 4297 
 4298 
 4299 
 4300 -- |shifted SABR volatility (lognormal or normal), with validity checks on the parameters
 4301 shiftedSabrVolatility :: (Double) -- ^strike
 4302  -> (Double) -- ^forward
 4303  -> (Double) -- ^expiryTime
 4304  -> (Double) -- ^alpha
 4305  -> (Double) -- ^beta
 4306  -> (Double) -- ^nu
 4307  -> (Double) -- ^rho
 4308  -> (Double) -- ^shift
 4309  -> (VolatilityType) -- ^volatilityType
 4310  -> IO ((Double))
 4311 shiftedSabrVolatility a1 a2 a3 a4 a5 a6 a7 a8 a9 =
 4312   let {a1' = realToFrac a1} in 
 4313   let {a2' = realToFrac a2} in 
 4314   let {a3' = realToFrac a3} in 
 4315   let {a4' = realToFrac a4} in 
 4316   let {a5' = realToFrac a5} in 
 4317   let {a6' = realToFrac a6} in 
 4318   let {a7' = realToFrac a7} in 
 4319   let {a8' = realToFrac a8} in 
 4320   let {a9' = (fromIntegral . fromEnum) a9} in 
 4321   preErrorCheck $ \a10' -> 
 4322   shiftedSabrVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
 4323   let {res' = realToFrac res} in
 4324   errorCheck  a10'>>
 4325   return (res')
 4326 
 4327 
 4328 
 4329 -- |lognormal SABR volatility using the Floc'h-Kennedy formula, with validity checks on the parameters
 4330 sabrFlochKennedyVolatility :: (Double) -- ^strike
 4331  -> (Double) -- ^forward
 4332  -> (Double) -- ^expiryTime
 4333  -> (Double) -- ^alpha
 4334  -> (Double) -- ^beta
 4335  -> (Double) -- ^nu
 4336  -> (Double) -- ^rho
 4337  -> IO ((Double))
 4338 sabrFlochKennedyVolatility a1 a2 a3 a4 a5 a6 a7 =
 4339   let {a1' = realToFrac a1} in 
 4340   let {a2' = realToFrac a2} in 
 4341   let {a3' = realToFrac a3} in 
 4342   let {a4' = realToFrac a4} in 
 4343   let {a5' = realToFrac a5} in 
 4344   let {a6' = realToFrac a6} in 
 4345   let {a7' = realToFrac a7} in 
 4346   preErrorCheck $ \a8' -> 
 4347   sabrFlochKennedyVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
 4348   let {res' = realToFrac res} in
 4349   errorCheck  a8'>>
 4350   return (res')
 4351 
 4352 
 4353 
 4354 -- |validate SABR parameters, throwing if they are not acceptable
 4355 validateSabrParameters :: (Double) -- ^alpha
 4356  -> (Double) -- ^beta
 4357  -> (Double) -- ^nu
 4358  -> (Double) -- ^rho
 4359  -> IO ()
 4360 validateSabrParameters a1 a2 a3 a4 =
 4361   let {a1' = realToFrac a1} in 
 4362   let {a2' = realToFrac a2} in 
 4363   let {a3' = realToFrac a3} in 
 4364   let {a4' = realToFrac a4} in 
 4365   preErrorCheck $ \a5' -> 
 4366   validateSabrParameters'_ a1' a2' a3' a4' a5' >>
 4367   errorCheck  a5'>>
 4368   return ()
 4369 
 4370 
 4371 
 4372 -- |initial guess (alpha, beta, nu, rho) for SABR calibration, per Le Floc'h and Kennedy
 4373 sabrGuess :: (Double) -- ^k_m
 4374  -> (Double) -- ^vol_m
 4375  -> (Double) -- ^k_0
 4376  -> (Double) -- ^vol_0
 4377  -> (Double) -- ^k_p
 4378  -> (Double) -- ^vol_p
 4379  -> (Double) -- ^forward
 4380  -> (Double) -- ^expiryTime
 4381  -> (Double) -- ^beta
 4382  -> (Double) -- ^shift
 4383  -> (VolatilityType) -- ^volatilityType
 4384  -> IO (([Double]))
 4385 sabrGuess a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
 4386   let {a1' = realToFrac a1} in 
 4387   let {a2' = realToFrac a2} in 
 4388   let {a3' = realToFrac a3} in 
 4389   let {a4' = realToFrac a4} in 
 4390   let {a5' = realToFrac a5} in 
 4391   let {a6' = realToFrac a6} in 
 4392   let {a7' = realToFrac a7} in 
 4393   let {a8' = realToFrac a8} in 
 4394   let {a9' = realToFrac a9} in 
 4395   let {a10' = realToFrac a10} in 
 4396   let {a11' = (fromIntegral . fromEnum) a11} in 
 4397   preArray $ \(a12'1, a12'2) -> 
 4398   preErrorCheck $ \a13' -> 
 4399   sabrGuess'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12'1  a12'2 a13' >>
 4400   peekDoubleArray  a12'1  a12'2>>= \a12'' -> 
 4401   errorCheck  a13'>>
 4402   return (a12'')
 4403 
 4404 
 4405 
 4406 -- vim: set ff=unix ts=8 sts=2 sw=2 et:
 4407 
 4408 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingBondEngine"
 4409   discountingBondEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4410 
 4411 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlRiskyBondEngine"
 4412   riskyBondEngine'_ :: ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4413 
 4414 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingSwapEngine"
 4415   discountingSwapEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4416 
 4417 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingFxForwardEngine"
 4418   discountingFxForwardEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4419 
 4420 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlDiscountingConstNotionalCrossCurrencySwapEngine"
 4421   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)))))))))))))
 4422 
 4423 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlCounterpartyAdjSwapEngine"
 4424   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))))))))))
 4425 
 4426 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticBarrierEngine"
 4427   analyticBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4428 
 4429 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticTwoAssetBarrierEngine"
 4430   analyticTwoAssetBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4431 
 4432 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticSoftBarrierEngine"
 4433   analyticSoftBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4434 
 4435 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticSimpleChooserEngine"
 4436   analyticSimpleChooserEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4437 
 4438 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticTwoAssetCorrelationEngine"
 4439   analyticTwoAssetCorrelationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4440 
 4441 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticWriterExtensibleOptionEngine"
 4442   analyticWriterExtensibleOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4443 
 4444 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticPartialTimeBarrierOptionEngine"
 4445   analyticPartialTimeBarrierOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4446 
 4447 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticBinaryBarrierEngine"
 4448   analyticBinaryBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4449 
 4450 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialBarrierEngine"
 4451   binomialBarrierEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4452 
 4453 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlVannaVolgaBarrierEngine"
 4454   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))))))))))))
 4455 
 4456 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDoubleBarrierEngine"
 4457   analyticDoubleBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4458 
 4459 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlVannaVolgaDoubleBarrierEngine"
 4460   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)))))))))))))
 4461 
 4462 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialDoubleBarrierEngine"
 4463   binomialDoubleBarrierEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4464 
 4465 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDoubleBarrierEngine"
 4466   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)))))))))))))))
 4467 
 4468 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticCliquetEngine"
 4469   analyticCliquetEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4470 
 4471 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticCompoundOptionEngine"
 4472   analyticCompoundOptionEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4473 
 4474 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousFixedLookbackEngine"
 4475   analyticContinuousFixedLookbackEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4476 
 4477 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousFloatingLookbackEngine"
 4478   analyticContinuousFloatingLookbackEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4479 
 4480 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticContinuousGeometricAveragePriceAsianEngine"
 4481   analyticContinuousGeometricAveragePriceAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4482 
 4483 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDigitalAmericanEngine"
 4484   analyticDigitalAmericanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4485 
 4486 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDigitalAmericanKOEngine"
 4487   analyticDigitalAmericanKOEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4488 
 4489 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDiscreteGeometricAveragePriceAsianEngine"
 4490   analyticDiscreteGeometricAveragePriceAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4491 
 4492 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDiscreteGeometricAverageStrikeAsianEngine"
 4493   analyticDiscreteGeometricAverageStrikeAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4494 
 4495 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTurnbullWakemanAsianEngine"
 4496   turnbullWakemanAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4497 
 4498 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticDividendEuropeanEngine"
 4499   analyticDividendEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4500 
 4501 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticEuropeanEngine"
 4502   analyticEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4503 
 4504 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticPerformanceEngine"
 4505   analyticPerformanceEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4506 
 4507 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardEuropeanEngine"
 4508   forwardEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4509 
 4510 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardBaroneAdesiWhaleyEngine"
 4511   forwardBaroneAdesiWhaleyEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4512 
 4513 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardBjerksundStenslandEngine"
 4514   forwardBjerksundStenslandEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4515 
 4516 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlForwardFdBlackScholesVanillaEngine"
 4517   forwardFdBlackScholesVanillaEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4518 
 4519 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCForwardEuropeanBSEngine1"
 4520   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)))))))))))))))
 4521 
 4522 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonForwardEuropeanEngine"
 4523   analyticHestonForwardEuropeanEngine'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4524 
 4525 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoEuropeanEngine"
 4526   quantoEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4527 
 4528 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoForwardEuropeanEngine"
 4529   quantoForwardEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4530 
 4531 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoForwardPerformanceEuropeanEngine"
 4532   quantoForwardPerformanceEuropeanEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4533 
 4534 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoBarrierEngine"
 4535   quantoBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4536 
 4537 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantoDoubleBarrierEngine"
 4538   quantoDoubleBarrierEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4539 
 4540 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCapFloorEngine1"
 4541   blackCapFloorEngine''_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4542 
 4543 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCapFloorEngine"
 4544   blackCapFloorEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4545 
 4546 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackSwaptionEngine"
 4547   blackSwaptionEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))
 4548 
 4549 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackSwaptionEngine1"
 4550   blackSwaptionEngine''_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4551 
 4552 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCapFloorEngine1"
 4553   bachelierCapFloorEngine''_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4554 
 4555 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCapFloorEngine"
 4556   bachelierCapFloorEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4557 
 4558 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlYoYInflationBlackCapFloorEngine"
 4559   yoyInflationBlackCapFloorEngine'_ :: ((C2HSImp.Ptr (CYoYInflationIndex')) -> ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4560 
 4561 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlYoYInflationUnitDisplacedBlackCapFloorEngine"
 4562   yoyInflationUnitDisplacedBlackCapFloorEngine'_ :: ((C2HSImp.Ptr (CYoYInflationIndex')) -> ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4563 
 4564 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlYoYInflationBachelierCapFloorEngine"
 4565   yoyInflationBachelierCapFloorEngine'_ :: ((C2HSImp.Ptr (CYoYInflationIndex')) -> ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4566 
 4567 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlInterpolatingCPICapFloorEngine"
 4568   interpolatingCPICapFloorEngine'_ :: ((C2HSImp.Ptr (CCPICapFloorTermPriceSurface')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4569 
 4570 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierSwaptionEngine"
 4571   bachelierSwaptionEngine'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4572 
 4573 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierSwaptionEngine1"
 4574   bachelierSwaptionEngine''_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4575 
 4576 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticBSMHullWhiteEngine"
 4577   analyticBSMHullWhiteEngine'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CHullWhite')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4578 
 4579 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticCapFloorEngine"
 4580   analyticCapFloorEngine'_ :: ((C2HSImp.Ptr (CAffineModel')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4581 
 4582 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dCapFloorEngine"
 4583   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))))))))))
 4584 
 4585 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticGJRGARCHEngine"
 4586   analyticGJRGARCHEngine'_ :: ((C2HSImp.Ptr (CGJRGARCHModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4587 
 4588 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonEngine"
 4589   analyticHestonEngine'_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4590 
 4591 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonHullWhiteEngine"
 4592   analyticHestonHullWhiteEngine'_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CHullWhite')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4593 
 4594 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesEngine"
 4595   batesEngine'_ :: ((C2HSImp.Ptr (CBatesModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4596 
 4597 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFFTVanillaEngine"
 4598   fftVanillaEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4599 
 4600 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlG2SwaptionEngine"
 4601   g2SwaptionEngine'_ :: ((C2HSImp.Ptr (CG2')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4602 
 4603 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlJumpDiffusionEngine"
 4604   jumpDiffusionEngine'_ :: ((C2HSImp.Ptr (CMerton76Process')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4605 
 4606 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCapFloorEngine"
 4607   treeCapFloorEngine'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4608 
 4609 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeSwaptionEngine"
 4610   treeSwaptionEngine'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4611 
 4612 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeVanillaSwapEngine"
 4613   treeVanillaSwapEngine'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4614 
 4615 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlVarianceGammaEngine"
 4616   varianceGammaEngine'_ :: ((C2HSImp.Ptr (CVarianceGammaProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4617 
 4618 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonEngine1"
 4619   analyticHestonEngine''_ :: ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4620 
 4621 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlAnalyticHestonHullWhiteEngine1"
 4622   analyticHestonHullWhiteEngine''_ :: ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CHullWhite')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4623 
 4624 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesEngine1"
 4625   batesEngine''_ :: ((C2HSImp.Ptr (CBatesModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4626 
 4627 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBaroneAdesiWhaleyApproximationEngine"
 4628   baroneAdesiWhaleyApproximationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4629 
 4630 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDetJumpEngine1"
 4631   batesDetJumpEngine''_ :: ((C2HSImp.Ptr (CBatesDetJumpModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4632 
 4633 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDetJumpEngine"
 4634   batesDetJumpEngine'_ :: ((C2HSImp.Ptr (CBatesDetJumpModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4635 
 4636 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpDetJumpEngine1"
 4637   batesDoubleExpDetJumpEngine''_ :: ((C2HSImp.Ptr (CBatesDoubleExpDetJumpModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4638 
 4639 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpDetJumpEngine"
 4640   batesDoubleExpDetJumpEngine'_ :: ((C2HSImp.Ptr (CBatesDoubleExpDetJumpModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4641 
 4642 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpEngine1"
 4643   batesDoubleExpEngine''_ :: ((C2HSImp.Ptr (CBatesDoubleExpModel')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4644 
 4645 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBatesDoubleExpEngine"
 4646   batesDoubleExpEngine'_ :: ((C2HSImp.Ptr (CBatesDoubleExpModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4647 
 4648 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBjerksundStenslandApproximationEngine"
 4649   bjerksundStenslandApproximationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4650 
 4651 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralCdsEngine"
 4652   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))))))))))
 4653 
 4654 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralEngine"
 4655   integralEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4656 
 4657 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlJamshidianSwaptionEngine"
 4658   jamshidianSwaptionEngine'_ :: ((C2HSImp.Ptr (COneFactorAffineModel')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4659 
 4660 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dSwaptionEngine"
 4661   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)))))))))))
 4662 
 4663 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dNonstandardSwaptionEngine"
 4664   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))))))))))))
 4665 
 4666 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dFloatFloatSwaptionEngine"
 4667   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)))))))))))))
 4668 
 4669 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlGaussian1dJamshidianSwaptionEngine"
 4670   gaussian1dJamshidianSwaptionEngine'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4671 
 4672 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlJuQuadraticApproximationEngine"
 4673   juQuadraticApproximationEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4674 
 4675 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlKirkEngine"
 4676   kirkEngine'_ :: ((C2HSImp.Ptr (CBlackProcess')) -> ((C2HSImp.Ptr (CBlackProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4677 
 4678 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMidPointCdsEngine"
 4679   midPointCdsEngine'_ :: ((C2HSImp.Ptr (CDefaultProbabilityTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))))
 4680 
 4681 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIsdaCdsEngine"
 4682   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)))))))))))
 4683 
 4684 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlReplicatingVarianceSwapEngine"
 4685   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))))))))))
 4686 
 4687 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlStulzEngine"
 4688   stulzEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4689 
 4690 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlLfmSwaptionEngine"
 4691   lfmSwaptionEngine'_ :: ((C2HSImp.Ptr (CLiborForwardModel')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4692 
 4693 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCapFloorEngine1"
 4694   treeCapFloorEngine''_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4695 
 4696 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeSwaptionEngine1"
 4697   treeSwaptionEngine''_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4698 
 4699 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeVanillaSwapEngine1"
 4700   treeVanillaSwapEngine''_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4701 
 4702 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdmQuantoHelper"
 4703   fdmQuantoHelper'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFdmQuantoHelper)))))))))
 4704 
 4705 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdmQuantoHelperQuantoAdjustment"
 4706   fdmQuantoHelperQuantoAdjustment'_ :: ((C2HSImp.Ptr (CFdmQuantoHelper)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))
 4707 
 4708 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdG2SwaptionEngine"
 4709   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)))))))))))
 4710 
 4711 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHullWhiteSwaptionEngine"
 4712   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))))))))))
 4713 
 4714 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesBarrierEngine"
 4715   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)))))))))))
 4716 
 4717 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonBarrierEngine"
 4718   fdHestonBarrierEngine'_ :: ((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))))))))))))
 4719 
 4720 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonBarrierEngine1"
 4721   fdHestonBarrierEngine''_ :: ((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))))))))))))))
 4722 
 4723 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonDoubleBarrierEngine"
 4724   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))))))))))))
 4725 
 4726 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCHestonHullWhiteEngine1"
 4727   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)))))))))))))))
 4728 
 4729 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCAmericanEngine1"
 4730   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))))))))))))))))))))
 4731 
 4732 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCBarrierEngine1"
 4733   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))))))))))))))))
 4734 
 4735 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDigitalEngine1"
 4736   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)))))))))))))))
 4737 
 4738 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteArithmeticAPEngine1"
 4739   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))))))))))))))
 4740 
 4741 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteArithmeticASEngine1"
 4742   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)))))))))))))
 4743 
 4744 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCDiscreteGeometricAPEngine1"
 4745   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)))))))))))))
 4746 
 4747 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanEngine1"
 4748   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)))))))))))))))
 4749 
 4750 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanGJRGARCHEngine1"
 4751   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))))))))))))))
 4752 
 4753 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanHestonEngine1"
 4754   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))))))))))))))
 4755 
 4756 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlIntegralHestonVarianceOptionEngine"
 4757   integralHestonVarianceOptionEngine'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))
 4758 
 4759 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCHullWhiteCapFloorEngine1"
 4760   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)))))))))))))
 4761 
 4762 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCHimalayaEngine1"
 4763   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)))))))))))))
 4764 
 4765 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCPagodaEngine1"
 4766   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)))))))))))))
 4767 
 4768 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCEuropeanBasketEngine1"
 4769   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)))))))))))))))
 4770 
 4771 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCAmericanBasketEngine1"
 4772   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)))))))))))))))))
 4773 
 4774 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCPerformanceEngine1"
 4775   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)))))))))))))
 4776 
 4777 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlMCVarianceSwapEngine1"
 4778   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)))))))))))))))
 4779 
 4780 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialVanillaEngine"
 4781   binomialVanillaEngine'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4782 
 4783 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesAsianEngine"
 4784   fdBlackScholesAsianEngine'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))))
 4785 
 4786 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine"
 4787   fdBlackScholesVanillaEngine'_ :: ((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))))))))))))
 4788 
 4789 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine1"
 4790   fdBlackScholesVanillaEngine''_ :: ((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))))))))))))))
 4791 
 4792 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine2"
 4793   fdBlackScholesVanillaEngineQuanto'_ :: ((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)))))))))))))
 4794 
 4795 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdBlackScholesVanillaEngine3"
 4796   fdBlackScholesVanillaEngineQuanto''_ :: ((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)))))))))))))))
 4797 
 4798 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine"
 4799   fdHestonVanillaEngine'_ :: ((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))))))))))))
 4800 
 4801 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine1"
 4802   fdHestonVanillaEngine''_ :: ((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))))))))))))))
 4803 
 4804 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine2"
 4805   fdHestonVanillaEngineQuanto'_ :: ((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)))))))))))))
 4806 
 4807 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonVanillaEngine3"
 4808   fdHestonVanillaEngineQuanto''_ :: ((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)))))))))))))))
 4809 
 4810 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonHullWhiteVanillaEngine"
 4811   fdHestonHullWhiteVanillaEngine'_ :: ((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))))))))))))))
 4812 
 4813 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlFdHestonHullWhiteVanillaEngine1"
 4814   fdHestonHullWhiteVanillaEngine''_ :: ((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))))))))))))))))
 4815 
 4816 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBinomialConvertibleEngine"
 4817   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))))))))))
 4818 
 4819 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableFixedRateBondEngine1"
 4820   blackCallableFixedRateBondEngine''_ :: ((C2HSImp.Ptr (CCallableBondVolatilityStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4821 
 4822 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableFixedRateBondEngine"
 4823   blackCallableFixedRateBondEngine'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4824 
 4825 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableZeroCouponBondEngine1"
 4826   blackCallableZeroCouponBondEngine''_ :: ((C2HSImp.Ptr (CCallableBondVolatilityStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4827 
 4828 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCallableZeroCouponBondEngine"
 4829   blackCallableZeroCouponBondEngine'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine))))))
 4830 
 4831 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableFixedRateBondEngine1"
 4832   treeCallableFixedRateBondEngine''_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4833 
 4834 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableFixedRateBondEngine"
 4835   treeCallableFixedRateBondEngine'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4836 
 4837 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableZeroCouponBondEngine1"
 4838   treeCallableZeroCouponBondEngine''_ :: ((C2HSImp.Ptr (CShortRateModel')) -> ((C2HSImp.Ptr (CTimeGrid)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4839 
 4840 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlTreeCallableZeroCouponBondEngine"
 4841   treeCallableZeroCouponBondEngine'_ :: ((C2HSImp.Ptr (CShortRateModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CPricingEngine)))))))
 4842 
 4843 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorAlpha"
 4844   alpha'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4845 
 4846 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorBeta"
 4847   beta'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4848 
 4849 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculator1"
 4850   blackCalculator''_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackCalculator')))))))))
 4851 
 4852 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculator"
 4853   blackCalculator'_ :: ((QlStrikedTypePayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackCalculator'))))))))
 4854 
 4855 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorDelta"
 4856   blackDelta'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4857 
 4858 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorDeltaForward"
 4859   deltaForward'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4860 
 4861 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorDividendRho"
 4862   dividendRho'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4863 
 4864 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorElasticity"
 4865   blackElasticity'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4866 
 4867 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorElasticityForward"
 4868   elasticityForward'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4869 
 4870 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorGamma"
 4871   blackGamma'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4872 
 4873 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorGammaForward"
 4874   gammaForward'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4875 
 4876 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorItmAssetProbability"
 4877   itmAssetProbability'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4878 
 4879 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorItmCashProbability"
 4880   itmCashProbability'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4881 
 4882 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorRho"
 4883   rho'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4884 
 4885 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorStrikeSensitivity"
 4886   strikeSensitivity'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4887 
 4888 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorStrikeGamma"
 4889   strikeGamma'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4890 
 4891 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorTheta"
 4892   blackTheta'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
 4893 
 4894 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorThetaPerDay"
 4895   blackThetaPerDay'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
 4896 
 4897 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorValue"
 4898   value'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4899 
 4900 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorVanna"
 4901   vanna'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
 4902 
 4903 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorVega"
 4904   vega'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4905 
 4906 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackCalculatorVolga"
 4907   volga'_ :: ((C2HSImp.Ptr (CBlackCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4908 
 4909 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculator1"
 4910   blackScholesCalculator''_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackScholesCalculator'))))))))))
 4911 
 4912 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculator"
 4913   blackScholesCalculator'_ :: ((QlStrikedTypePayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackScholesCalculator')))))))))
 4914 
 4915 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorDelta"
 4916   blackScholesDelta'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4917 
 4918 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorElasticity"
 4919   blackScholesElasticity'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4920 
 4921 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorGamma"
 4922   blackScholesGamma'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4923 
 4924 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorTheta"
 4925   blackScholesTheta'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4926 
 4927 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackScholesCalculatorThetaPerDay"
 4928   blackScholesThetaPerDay'_ :: ((C2HSImp.Ptr (CBlackScholesCalculator')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4929 
 4930 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculator1"
 4931   bachelierCalculator''_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBachelierCalculator)))))))))
 4932 
 4933 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculator"
 4934   bachelierCalculator'_ :: ((QlStrikedTypePayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBachelierCalculator))))))))
 4935 
 4936 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorAlpha"
 4937   bachelierAlpha'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4938 
 4939 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorBeta"
 4940   bachelierBeta'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4941 
 4942 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorDelta"
 4943   bachelierDelta'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4944 
 4945 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorDeltaForward"
 4946   bachelierDeltaForward'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4947 
 4948 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorDividendRho"
 4949   bachelierDividendRho'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4950 
 4951 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorElasticity"
 4952   bachelierElasticity'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4953 
 4954 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorElasticityForward"
 4955   bachelierElasticityForward'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4956 
 4957 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorGamma"
 4958   bachelierGamma'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4959 
 4960 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorGammaForward"
 4961   bachelierGammaForward'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4962 
 4963 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorItmAssetProbability"
 4964   bachelierItmAssetProbability'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4965 
 4966 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorItmCashProbability"
 4967   bachelierItmCashProbability'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4968 
 4969 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorRho"
 4970   bachelierRho'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4971 
 4972 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorStrikeSensitivity"
 4973   bachelierStrikeSensitivity'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4974 
 4975 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorStrikeGamma"
 4976   bachelierStrikeGamma'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4977 
 4978 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorTheta"
 4979   bachelierTheta'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
 4980 
 4981 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorThetaPerDay"
 4982   bachelierThetaPerDay'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
 4983 
 4984 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorValue"
 4985   bachelierValue'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 4986 
 4987 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorVanna"
 4988   bachelierVanna'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4989 
 4990 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorVega"
 4991   bachelierVega'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4992 
 4993 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBachelierCalculatorVolga"
 4994   bachelierVolga'_ :: ((C2HSImp.Ptr (CBachelierCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 4995 
 4996 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculator"
 4997   blackDeltaCalculator'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackDeltaCalculator))))))))))
 4998 
 4999 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculatorDeltaFromStrike"
 5000   deltaFromStrike'_ :: ((C2HSImp.Ptr (CBlackDeltaCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 5001 
 5002 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculatorStrikeFromDelta"
 5003   strikeFromDelta'_ :: ((C2HSImp.Ptr (CBlackDeltaCalculator)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 5004 
 5005 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlBlackDeltaCalculatorAtmStrike"
 5006   atmStrike'_ :: ((C2HSImp.Ptr (CBlackDeltaCalculator)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
 5007 
 5008 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormula1"
 5009   blackFormula''_ :: ((QlPlainVanillaPayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
 5010 
 5011 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormula"
 5012   blackFormula'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))
 5013 
 5014 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaCashItmProbability1"
 5015   blackCashItmProbability''_ :: ((QlPlainVanillaPayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))
 5016 
 5017 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaCashItmProbability"
 5018   blackCashItmProbability'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
 5019 
 5020 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDev1"
 5021   blackImpliedStdDev''_ :: ((QlPlainVanillaPayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))))
 5022 
 5023 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDev"
 5024   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)))))))))))
 5025 
 5026 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDevApproximation1"
 5027   blackImpliedStdDevApproximation''_ :: ((QlPlainVanillaPayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
 5028 
 5029 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaImpliedStdDevApproximation"
 5030   blackImpliedStdDevApproximation'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))
 5031 
 5032 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaStdDevDerivative1"
 5033   blackStdDevDerivative''_ :: ((QlPlainVanillaPayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
 5034 
 5035 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaStdDevDerivative"
 5036   blackStdDevDerivative'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
 5037 
 5038 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBlackFormulaVolDerivative"
 5039   blackVolDerivative'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))
 5040 
 5041 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormula1"
 5042   bachelierBlackFormula''_ :: ((QlPlainVanillaPayoff) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))
 5043 
 5044 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibBachelierBlackFormula"
 5045   bachelierBlackFormula'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
 5046 
 5047 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlQuantLibDefaultThetaPerDay"
 5048   defaultThetaPerDay'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
 5049 
 5050 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeSabrLogNormalVolatility"
 5051   unsafeSabrLogNormalVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))
 5052 
 5053 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeShiftedSabrVolatility"
 5054   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)))))))))))
 5055 
 5056 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeSabrNormalVolatility"
 5057   unsafeSabrNormalVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))
 5058 
 5059 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlUnsafeSabrVolatility"
 5060   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))))))))))
 5061 
 5062 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSabrVolatility"
 5063   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))))))))))
 5064 
 5065 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlShiftedSabrVolatility"
 5066   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)))))))))))
 5067 
 5068 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSabrFlochKennedyVolatility"
 5069   sabrFlochKennedyVolatility'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))
 5070 
 5071 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlValidateSabrParameters"
 5072   validateSabrParameters'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))))
 5073 
 5074 foreign import ccall safe "QuantLib/PricingEngine.chs.h qlSabrGuess"
 5075   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 ())))))))))))))))