/src/main/java/net/finmath/integration/PiecewiseContantDoubleUnaryOperator.java
error = newIntegral - value - value;
error = newIntegral - integral - value;
else { double error = 0.0; double integral = operator.applyAsDouble(values[indexUpperOfLowerBound]) * (intervalRightPoints[indexUpperOfLowerBound]-lowerBound); for(int i=indexUpperOfLowerBound; i<indexLowerOfUpperBound; i++) { final double value = operator.applyAsDouble(values[i+1]) * (intervalRightPoints[i+1]-intervalRightPoints[i]) - error; final double newIntegral = integral + value; <extra_id_0> integral = newIntegral; } integral += operator.applyAsDouble(values[indexLowerOfUpperBound+1]) * (upperBound-intervalRightPoints[indexLowerOfUpperBound]) - error; return integral; } }