hardware support for interval arithmetic
Vaughan Pratt
uunet!cs.Stanford.EDU!pratt
Thu Oct 5 23:18:55 PDT 1995
That introduces the question of whether "external" intervals
ought to be supported, as Kahan proposed in 1965:
[a,b] means a<=x<=b if a<=b
[a,b] means a<=x union x<=b if a>b
You have my strong yes vote on this. You don't need it for polynomial
arithmetic (+ - *), but when you pass to rational arithmetic by
bringing in division you pass from affine geometry to projective
geometry. The real line is made projective by filling in the "hole at
infinity" to complete it to a circle. Kahan's proposal gives a neat way
to split that circle into two connected components such that either of
0 and Inf can belong to either component.
This extends intervals to neatly encompass division by zero,
for continued fractions particularly, but at the cost of
inducing a fair amount of interpretive overhead even if all
intervals are normal.
Not that big a deal. The only increment in interpretive overhead is
for addition. Subtraction and division can be reduced to negation and
reciprocal, whose effect on [a,b] is to map it to [-b,-a] and [1/b,1/a]
respectively, so that's very simple and leaves just addition and
multiplication. Already with polynomial arithmetic, multiplication has
plenty of interpretive overhead (try it). The only significant
complication added by the passage to rational arithmetic is to bring
the interpretive complexity of addition up to essentially the same
level as that of multiplication. That's all there is to it.
Transcendental arithmetic is more fun.
Of course, mathematically the idea of distinct -0 and +0 values
is pretty silly, since by any of the usual axiom systems one
can quickly show that -0 = +0 and so there is no difference in
value; why there should be a difference in representation when
there is no difference in value may be a matter of convenience
for some classes of computation, but it muddies the C standard
which tries to dictate numeric properties only in terms of the
resulting *values*.
Judging IEEE decisions by bringing in random mathematical facts is
pretty pointless given that IEEE addition is not associative to begin
with. By mucking with the representation you can recover associativity
(Russian I think), but it is a nice result (Kahan I think) that you
*must* lose commutativity in the process!
IEEE users need practical rationalizations of the IEEE system. The
rationalization I rely on, rightly or wrongly, is that IEEE numbers
form a finite subset of the projective real axis. Unsigned Inf and
unsigned 0 are both missing (ok so I lied about filling in the hole),
but *nonstandard* (in the sense of A. Robinson) approximants on either
side are provided (so it was a very white lie). Standard mathematics
denies the existence of infinities and infinitesimals, but it requires
second order logic to say this. Robinson's idea was to stick to the
language of first order logic so that infinities and infinitesimals
could be postulated and worked with without generating contradictions.
I haven't actually checked that signed 0 and Inf can be accounted for
in this way, but if not then I'd certainly want to know more about
which first order properties of the reals I was still allowed to
assume. Those properties have no doubt been spelled out by Velvel
somewhere, yes?
Vaughan Pratt
More information about the Numeric-interest
mailing list