/src/main/java/net/finmath/montecarlo/BrownianMotionFromMersenneRandomNumbers.java
for( short path=0; path<numberOfPaths; path++) {
for ( int path=0; path<numberOfPaths; path++ ) {
final MersenneTwister mersenneTwister = new MersenneTwister(seed); final double[][][] brownianIncrementsArray = new double[timeDiscretization.getNumberOfTimeSteps()][numberOfFactors][numberOfPaths]; final double[] sqrtOfTimeStep = new double[timeDiscretization.getNumberOfTimeSteps()]; for(int timeIndex=0; timeIndex<sqrtOfTimeStep.length; timeIndex++) { sqrtOfTimeStep[timeIndex] = Math.sqrt(timeDiscretization.getTimeStep(timeIndex)); } <extra_id_0> for(int timeIndex=0; timeIndex<timeDiscretization.getNumberOfTimeSteps(); timeIndex++) { final double sqrtDeltaT = sqrtOfTimeStep[timeIndex]; for(int factor=0; factor<numberOfFactors; factor++) { final double uniformIncrement = mersenneTwister.nextDoubleFast(); brownianIncrementsArray[timeIndex][factor][path] = NormalDistribution.inverseCumulativeDistribution(uniformIncrement) * sqrtDeltaT; }