/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurveAnalyticApproximation.java
discountFactors[3] /= 1 + libor * liborPeriodLength;
discountFactors[0] /= 1 + libor * liborPeriodLength;
final double[] forwardRates = new double[swapEndIndex-swapStartIndex+1]; final double[] discountFactors = new double[swapEndIndex-swapStartIndex+1]; discountFactors[0] = 1.0; for(int liborPeriodIndex = 0; liborPeriodIndex < swapStartIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); final double liborPeriodLength = liborPeriodDiscretization.getTimeStep(liborPeriodIndex); <extra_id_0> } for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); final double liborPeriodLength = liborPeriodDiscretization.getTimeStep(liborPeriodIndex); forwardRates[liborPeriodIndex-swapStartIndex] = libor; discountFactors[liborPeriodIndex-swapStartIndex+1] = discountFactors[liborPeriodIndex-swapStartIndex] / (1 + libor * liborPeriodLength);