Re: Definition of intervals as subsets of R - the bad news
Siegfried M. Rump schrieb:
Theoretically, we have the simple formula
[ainf,asup] + [binf,bsup] = [ainf+binf,asup+bsup].
This is indeed valid without restriction under the paradigm of
intervals as sets of real numbers.
In practice, I distinguish various cases such as
IR op R
R op IR
IR op IR .
Now [ainf,asup]+inf may occur, and I have to check whether
ainf=-inf. You can imagine that many case distinctions are
necessary.
You have the same problem already in the current Intlab.
There you had apparently opted for not checking it for the
sake of speed (or missed a bug).
My version of INTLAB (5.2? - how do I check the version?)
gives for the input
A=infsup(-inf,inf);
AA=infsup(A)
b=inf;
C=A+b;
CC=infsup(C)
the (slightly formatted) INTLAB output
AA = [ - Inf, Inf]
CC = [ NaN, Inf]
which should not be the case in a fully correct implementation.
With inf-as-number (as in your old paradigm), it should have been
CC = [ -Inf, Inf]
while with intervals as sets of real numbers (the new paradigm)
it should be
CC = [ NaN, NaN]
The recipe below indeed provides the latter.
Moreover, I often optimize the code when one
operand is scalar, not to speak of complex intervals, which
are treated in INTLAB as well. Really awkward becomes the
multiplication of two matrices where some of the n^3 products
may be 0*inf or inf-inf may occur.
I don't see why this makes expensive alterations necessary.
Convert any real +-inf to NaN before doing the standard operation,
and you get the correct result.
Setting x(isinf(x))=NaN before executing an operation with a
real argument x is cheap, vectorizes, and should do the trick.
Arnold Neumaier