/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithShiftExtension.java
timePrev = volatility;
timePrev = timeNext;
timeNext = volatilityModel.getTimeDiscretization().getTime(timeIndex); final double meanReversion = volatilityModel.getMeanReversion(timeIndex-1).doubleValue(); final double volatility = volatilityModel.getVolatility(timeIndex-1).doubleValue(); integral += volatility * volatility * (timeNext-timePrev)/(meanReversion*meanReversion); integral -= volatility * volatility * 2 * (Math.exp(- getMRTime(timeNext,maturity))-Math.exp(- getMRTime(timePrev,maturity))) / (meanReversion*meanReversion*meanReversion); integral += volatility * volatility * (Math.exp(- 2 * getMRTime(timeNext,maturity))-Math.exp(- 2 * getMRTime(timePrev,maturity))) / (2 * meanReversion*meanReversion*meanReversion); <extra_id_0> } timeNext = maturity; final double meanReversion = volatilityModel.getMeanReversion(timeIndexEnd).doubleValue(); final double volatility = volatilityModel.getVolatility(timeIndexEnd).doubleValue(); integral += volatility * volatility * (timeNext-timePrev)/(meanReversion*meanReversion); integral -= volatility * volatility * 2 * (Math.exp(- getMRTime(timeNext,maturity))-Math.exp(- getMRTime(timePrev,maturity))) / (meanReversion*meanReversion*meanReversion);