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