March 29th, 2013, 1:16 pm
The idea behind CenteredInterval X(double center, double delta) is to create a different definition of an interval and overload all operators to compute resultant values of "centre" and "delta".For example, for multiplication, Y=A*B, in the common case in which |centre| > |delta|, A.centre>0, B.centre>0, the proper interval calculation might be:Y.centre = A.centre*B.centre + A.delta*B.delta;Y.delta = A.delta*B.centre + A.centre*B.delta + LSB(Y.centre)/2;It's an exercise for the student to fill out the other 7 cases of |centre| ≤ |delta| and the signs on A.centre and B.centre; and to cleverly optimize/compact/collapse the case logic for speed.