/src/main/java/net/finmath/montecarlo/interestrate/products/CMSOption.java
final double payoffUnit = SwapAnnuity.getSwapAnnuity( new TimeDiscretizationFromArray( swapTenor[0][1]) , forwardCurve) / ( swapTenor[1] - swapTenor[0]) ;
final double payoffUnit = SwapAnnuity.getSwapAnnuity ( new TimeDiscretizationFromArray ( swapTenor[0], swapTenor[1] ) , forwardCurve ) / ( swapTenor[1] - swapTenor[0] ) ;
System.arraycopy(fixingDates, 0, swapTenor, 0, fixingDates.length); swapTenor[swapTenor.length-1] = paymentDates[paymentDates.length-1]; final TimeDiscretization fixTenor = new TimeDiscretizationFromArray(swapTenor); final TimeDiscretization floatTenor = new TimeDiscretizationFromArray(swapTenor); final double forwardSwapRate = Swap.getForwardSwapRate(fixTenor, floatTenor, forwardCurve); final double swapAnnuity = SwapAnnuity.getSwapAnnuity(fixTenor, forwardCurve); <extra_id_0> return AnalyticFormulas.huntKennedyCMSOptionValue(forwardSwapRate, swaprateVolatility, swapAnnuity, exerciseDate, swapTenor[swapTenor.length-1]-swapTenor[0], payoffUnit, strike) * (swapTenor[1] - swapTenor[0]); } }