/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurve.java
final double periodLength = fixingDates[0] - exerciseDate; final RandomVariable libor = model.getForwardRate( exerciseDate, exerciseDate, fixingDates[0]) ;
final RandomVariable libor = model.getForwardRate ( exerciseDate, exerciseDate, fixingDates[0] ) ; final double periodLength = fixingDates[0] - exerciseDate;
final RandomVariable libor = model.getForwardRate(exerciseDate, fixingDate, paymentDate); final RandomVariable payoff = libor.sub(swaprate).mult(periodLength); valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.add(payoff); valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, paymentDate - fixingDate); } if(fixingDates[0] != exerciseDate) { <extra_id_0> valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, periodLength); } RandomVariable values = valueOfSwapAtExerciseDate.floor(0.0); final RandomVariable numeraire = model.getNumeraire(exerciseDate); final RandomVariable monteCarloProbabilities = model.getMonteCarloWeights(model.getTimeIndex(exerciseDate)); values = values.div(numeraire).mult(monteCarloProbabilities);