/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java
final RandomVariable[] parameters = ( ( ShortRateVolatilityModelParametric) volatilityModel).getParameter( ) ;final RandomVariable volatility = volatilityModel.getVolatility( timeIndex-1) ;
final RandomVariable volatility = volatilityModel.getVolatility ( timeIndex-1 ) ;
double timePrev = time; double timeNext; RandomVariable expMRTimePrev = getMRTime(timePrev,maturity).mult(-2).exp(); for(int timeIndex=timeIndexStart+1; timeIndex<=timeIndexEnd; timeIndex++) { timeNext = volatilityModel.getTimeDiscretization().getTime(timeIndex); final RandomVariable meanReversion = volatilityModel.getMeanReversion(timeIndex-1); <extra_id_0> 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; expMRTimePrev = expMRTimeNext;