/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
if( swaprate != 0.0d) {
if ( swaprate != 0.0 ) {
for(int periodIndex = legSchedule.getNumberOfPeriods() - 1; periodIndex >= 0; periodIndex--) { final double fixingTime = FloatingpointDate.getFloatingPointDateFromDate(model.getReferenceDate().toLocalDate(), legSchedule.getPeriod(periodIndex).getFixing()); final double paymentTime = FloatingpointDate.getFloatingPointDateFromDate(model.getReferenceDate().toLocalDate(), legSchedule.getPeriod(periodIndex).getPayment()); final double periodLength = legSchedule.getPeriodLength(periodIndex); final RandomVariable numeraireAtPayment = model.getNumeraire(paymentTime); final RandomVariable monteCarloProbabilitiesAtPayment = model.getMonteCarloWeights(paymentTime); <extra_id_0> final RandomVariable periodCashFlowFix = model.getRandomVariableForConstant(swaprate * periodLength * notional).div(numeraireAtPayment).mult(monteCarloProbabilitiesAtPayment); value = value.add(periodCashFlowFix); } if(paysFloat) { final RandomVariable libor = model.getForwardRate(fixingTime, fixingTime, paymentTime); final RandomVariable periodCashFlowFloat = libor.mult(periodLength).mult(notional).div(numeraireAtPayment).mult(monteCarloProbabilitiesAtPayment);