Do we need absolute comparisons...?
Folks,
I was working on my decorations argument when I came
across an example involving the comparison of absolute
values.
While, in 754, comparison of absolute values (|a| < |b|
or |a| <= |b|) is formally equivalent to taking the
absolute value followed by the compare, many companies
have chosen to provide them as primitives for two
reasons: (1) They are easy to do (just strip off the
sign bit & send it on to the compare circuit). And (2)
they are commonly done in large linear algebra problems
that form the basis for benchmarks (usually found in
choosing a pivot element).
In 754 we chose not to define them on the grounds that
a definition was not needed for a primitive that was
equivalent to a sequence of things we DID define.
But the interval situation is not so clear.
Even granting that an absolute comparison is probably
STILL equivalent to taking the absolute value followed
by a comparison we are defining, which comparison applies?
In most floating-point cases, testing for |a| < |b|
REQUIRES that the resulting |b| be the greater as one is
contemplating doing some later operation like b^2 - a^2
which is required to be positive.
But, in the case of a pivot, testing for |a| <= |b| is
mostly a heuristic intending to assure that |a/b| is small.
And, both the floating-point programmer & the compiler
writer can assume that if an (a,b) pair passes either test
that b is definitely the larger of the two. So the intent
of the programmer never becomes an issue.
But it might be an issue for the interval programmer.
So, is the test for |aa| < |bb| to be |aa|2 < |bb|1 ?
Or should |aa| <= |bb| imply |aa|1 <= |bb|1 and
|aa|2 <= |bb|2 ?
Sorry to raise this so late in the discussion of motion 13
but I only just now thought of it.
There ya go, folks...
Dan