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