final SpreadIntegrant integrant = new SpreadIntegrant(discountedCashFlowFixed, alphaFixed, tau2Fixed, discountedCashFlowIbor, alphaIbor, tau2Ibor, alphaTp, tau2Tp, rhobar, strike,
cmsSpread.isCap());
final double absoluteTolerance = 1.0E-6; // 1.0E-5;
final double relativeTolerance = 1.0E-6; // 1.0E-5
final RungeKuttaIntegrator1D integrator1D = new RungeKuttaIntegrator1D(absoluteTolerance, relativeTolerance, NB_INTEGRATION);
final IntegratorRepeated2D integrator2D = new IntegratorRepeated2D(integrator1D);
double pv = 0.0;
try {
pv = 1.0 / (2.0 * Math.PI * Math.sqrt(1 - rhobar * rhobar))
* integrator2D.integrate(integrant, new Double[] {-INTEGRATION_LIMIT, -INTEGRATION_LIMIT}, new Double[] {INTEGRATION_LIMIT, INTEGRATION_LIMIT});
} catch (final Exception e) {
throw new MathException(e);
}
return MultipleCurrencyAmount.of(cmsSpread.getCurrency(), dftp * pv * cmsSpread.getNotional() * cmsSpread.getPaymentYearFraction());
}