/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurve.java
valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount( paymentDate - fixingDate) ;
valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount ( libor, paymentDate - fixingDate ) ;
final double paymentDate = paymentDates[period]; final double swaprate = swaprates[period]; final double periodLength = periodLengths != null ? periodLengths[period] : paymentDate - fixingDate; final RandomVariable libor = model.getForwardRate(exerciseDate, fixingDate, paymentDate); final RandomVariable payoff = libor.sub(swaprate).mult(periodLength); valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.add(payoff); <extra_id_0> } if(fixingDates[0] != exerciseDate) { final RandomVariable libor = model.getForwardRate(exerciseDate, exerciseDate, fixingDates[0]); final double periodLength = fixingDates[0] - exerciseDate; valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, periodLength); }