/src/main/java/net/finmath/singleswaprate/annuitymapping/BasicPiterbargAnnuityMapping.java
value += ( Math.pow( term, -exponents[index]) ) *periodLengths[index] /denominators[index]; for( int index = 0; index < numberOfPeriods; index++) {double value = 0.0;
double value = 0.0; for ( int index = 0; index < numberOfPeriods; index++ ) { value += ( Math.pow ( term, -exponents[index] ) ) *periodLengths[index] /denominators[index];
} @Override public double getValue(final double swapRate) { double term = periodLengths[numberOfPeriods-1] *swapRate +1.0; term /= periodLengths[numberOfPeriods-1] *initialSwapRates[numberOfPeriods -1] +1.0; term /= exponentialDriverMeans[numberOfPeriods -1]; <extra_id_0> } return initialAnnuities[numberOfPeriods-1] /value - expectationCorrection * normalizer.getValue(swapRate); } @Override public double getFirstDerivative(final double swapRate) { double term = periodLengths[numberOfPeriods-1] *swapRate +1.0;