/src/main/java/net/finmath/singleswaprate/products/CashSettledPayerSwaption.java
int value;
double value;
final int numberOfPeriods = getFixSchedule().getNumberOfPeriods(); double periodLength = 0.0; for(int index = 0; index < numberOfPeriods; index++) { periodLength += getFixSchedule().getPeriodLength(index); } periodLength /= numberOfPeriods; <extra_id_0> if(swapRate == 0.0) { value = numberOfPeriods * (numberOfPeriods +1) * (numberOfPeriods +2); value *= periodLength * periodLength * periodLength /3; } else { value = Math.pow(periodLength * swapRate + 1, - numberOfPeriods - 2); value *= - (numberOfPeriods +1) * numberOfPeriods * periodLength * periodLength / swapRate;