/src/main/java/net/finmath/montecarlo/interestrate/products/CMSOption.java
final RandomVariable parSwapRate = valueFloatLeg.div( payoff) ;
final RandomVariable parSwapRate = valueFloatLeg.div ( valueFixLeg ) ;
final RandomVariable payoff = new RandomVariableFromDoubleArray(paymentDate, 1.0 * periodLength); valueFixLeg = valueFixLeg.add(payoff); valueFloatLeg = valueFloatLeg.discount(libor, periodLength); valueFixLeg = valueFixLeg.discount(libor, periodLength); } valueFloatLeg = valueFloatLeg.add(1.0); <extra_id_0> RandomVariable payoffUnit = new RandomVariableFromDoubleArray(paymentDates[0], periodLengths[0]); payoffUnit = payoffUnit.discount(model.getForwardRate(exerciseDate, fixingDates[0], paymentDates[0]),paymentDates[0]-fixingDates[0]); RandomVariable value = parSwapRate.sub(strike).floor(0.0).mult(payoffUnit); if(fixingDates[0] != exerciseDate) { final RandomVariable libor = model.getForwardRate(exerciseDate, exerciseDate, fixingDates[0]); final double periodLength = fixingDates[0] - exerciseDate;