/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionAnalyticApproximation.java
swapAnnuity += swapTenor[periodEndIndex-swapStartIndex] * ( discountFactors[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]) ;
swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * ( swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex] ) ;
discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor(model, liborPeriodDiscretization.getTime(liborPeriodIndex+1)); } final double[] swapAnnuities = new double[swapTenor.length-1]; double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { final int periodEndIndex = liborPeriodDiscretization.getTimeIndex(swapTenor[swapPeriodIndex+1]); <extra_id_0> swapAnnuities[swapPeriodIndex] = swapAnnuity; } final double[] swapCovarianceWeights = new double[swapEndIndex-swapStartIndex]; double valueFloatLeg = 0.0; for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double liborPeriodLength = liborPeriodDiscretization.getTimeStep(liborPeriodIndex);