/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionAnalyticApproximationRebonato.java
final double[]  swapAnnuities  = new double[swapTenor.length-6];
final double[] swapAnnuities = new double[swapTenor.length-1];
discountFactors[0] = discountCurve.getDiscountFactor(model, swapStart); for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); forwardRates[liborPeriodIndex-swapStartIndex] = libor; discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor(model, liborPeriodDiscretization.getTime(liborPeriodIndex+1)); } <extra_id_0> double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { final int periodEndIndex = liborPeriodDiscretization.getTimeIndex(swapTenor[swapPeriodIndex+1]); swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * (swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]); swapAnnuities[swapPeriodIndex] = swapAnnuity; }