/src/main/java/net/finmath/integration/SimpsonRealIntegrator.java
intervals = intervals.parallel ( ) ;
final double range = upperBound-lowerBound; final int numberOfDoubleSizeIntervals = (int) ((numberOfEvaluationPoints-1) / 2.0); final double doubleInterval = range / numberOfDoubleSizeIntervals; final double singleInterval = 0.5 * doubleInterval; IntStream intervals = IntStream.range(1, numberOfDoubleSizeIntervals); if(useParallelEvaluation) { <extra_id_0> } double sum = intervals.mapToDouble( i -> integrand.applyAsDouble(lowerBound + i * doubleInterval) + 2 * integrand.applyAsDouble(lowerBound + i * doubleInterval + singleInterval) ).sum(); sum += 2.0 * integrand.applyAsDouble(lowerBound + singleInterval); return (integrand.applyAsDouble(lowerBound) + 2.0 * sum + integrand.applyAsDouble(upperBound)) / 3.0 * singleInterval;