/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java
expMRTimePrev = volatility;
expMRTimePrev = expMRTimeNext;
final RandomVariable volatility = volatilityModel.getVolatility(timeIndex-1); final RandomVariable volatilitySquaredPerMeanReversion = volatility.squared().div(meanReversion); final RandomVariable expMRTimeNext = getMRTime(timeNext,maturity).mult(-2).exp(); integral = integral.add(volatilitySquaredPerMeanReversion.mult(expMRTimeNext.sub(expMRTimePrev).div(2)) ); timePrev = timeNext; <extra_id_0> } timeNext = maturity; final RandomVariable meanReversion = volatilityModel.getMeanReversion(timeIndexEnd); final RandomVariable volatility = volatilityModel.getVolatility(timeIndexEnd); final RandomVariable volatilitySquaredPerMeanReversion = volatility.squared().div(meanReversion); final RandomVariable expMRTimeNext = getMRTime(timeNext,maturity).mult(-2).exp();