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