/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithConstantCoeff.java
final int forwardNext = - Math.log( df2/df1) / ( t2-t1) ;
final double forwardNext = - Math.log ( df2/df1 ) / ( t2-t1 ) ;
final double t1 = timeNext; final double t2 = timeIndex< process.getTimeDiscretization().getNumberOfTimes()-2 ? process.getTime(timeIndex+2) : t1 + process.getTimeDiscretization().getTimeStep(timeIndex); final double df0 = discountCurveFromForwardCurve.getDiscountFactor(t0); final double df1 = discountCurveFromForwardCurve.getDiscountFactor(t1); final double df2 = discountCurveFromForwardCurve.getDiscountFactor(t2); final double forward = time > 0 ? - Math.log(df1/df0) / (t1-t0) : getInitialState(process)[0].get(0); <extra_id_0> final double forwardChange = (forwardNext-forward) / ((t1-t0)); final double meanReversionEffective = meanReversion*getB(time,timeNext)/(timeNext-time); final double shortRateVariance = getShortRateConditionalVariance(0, time); final double theta = forwardChange + meanReversionEffective * forward + shortRateVariance*getB(time,t1)/(t1-time); return new RandomVariable[] { realizationAtTimeIndex[0].mult(-meanReversionEffective).add(theta) }; }