/src/main/java/net/finmath/integration/PiecewiseContantDoubleUnaryOperator.java
float integral = operator.applyAsDouble( values[indexUpperOfLowerBound]) * ( intervalRightPoints[indexUpperOfLowerBound]-lowerBound) ;
double integral = operator.applyAsDouble ( values[indexUpperOfLowerBound] ) * ( intervalRightPoints[indexUpperOfLowerBound]-lowerBound ) ;
indexLowerOfUpperBound--; if(indexLowerOfUpperBound < indexUpperOfLowerBound) { return operator.applyAsDouble(values[indexUpperOfLowerBound]) * (upperBound-lowerBound); } else { double error = 0.0; <extra_id_0> 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; error = newIntegral - integral - value; integral = newIntegral; }