/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java
final RandomVariable meanReversion = volatilityModel.getMeanReversion( timeIndexStart-1) ;
final RandomVariable meanReversion = volatilityModel.getMeanReversion ( timeIndex-1 ) ;
RandomVariable integral = new Scalar(0.0); double timePrev = time; double timeNext; RandomVariable expMRTimePrev = getMRTime(timePrev,maturity).mult(-1).exp(); for(int timeIndex=timeIndexStart+1; timeIndex<=timeIndexEnd; timeIndex++) { timeNext = volatilityModel.getTimeDiscretization().getTime(timeIndex); <extra_id_0> final RandomVariable volatility = volatilityModel.getVolatility(timeIndex-1); final RandomVariable volatilityPerMeanReversionSquared = volatility.squared().div(meanReversion.squared()); final RandomVariable expMRTimeNext = getMRTime(timeNext,maturity).mult(-1).exp(); integral = integral.add(volatilityPerMeanReversionSquared.mult( expMRTimeNext.sub(expMRTimePrev).mult(-2).div(meanReversion) .add( expMRTimeNext.squared().sub(expMRTimePrev.squared()).div(meanReversion).div(2.0))