CBFalconer said:
Keith said:
... snip ...
I believe you have misunderstood what I wrote.
Let's suppose that, in accordance with your model, the stored double
value 1.0 represents the range of real numbers 1.0-EPS .. 1.0+EPS
assuming for simplicity that the range is symmetric). Then given:
double x = 1.0;
double y = 1.0;
both x and y represent identical ranges. Each of these identical
ranges contains infinitely many real numbers. Some of the numbers
within x's range are less that some of the numbers within y's range;
for example, 1.0-EPS (which is in x's range) is less than 1.0+EPS
(which is in y's range). Nevertheless, in your model, (x < y) must
yield 0.
And just what do you mean by "the value in x (or y)"? Are you
implying that x has just a single value?
Incidentally, in my article there were 5 paragraphs following what you
quoted, full of questions directed to you in an attempt to understand
your conception of C's floating-point model. You have snipped those
paragraphs without so much as a "[...]". My assumption is that you
were unable to answer my questions because your floating-point model
is actually inconsistent. Either that or you didn't bother to read
them.
No, I try to keep messages short and simple, and dealing with one
aspect at a time. This is getting far too long.
So you chose one out of a number of points I made, completely
misunderstood it, and ignored the rest.
I spent a substantial amount of time writing that article. Apparently
it was wasted.
WRT the values in x (or y), those values are exact, but they do NOT
represent exactness.
I think this is the first time you've acknowledged that there *is* an
exact value. That single exact value *is* the value of the
floating-point value. Read the standard; that's essentially what it
says.
This is due to the fundamental nature of a
floating value, i.e. any exact value ALWAYS represents a range,
such as:
x * (1 - x_EPSILON) through x * (1 + x_EPSILON)
Why that specific range?
For x==1.0 (type double), that range includes the following real
numbers:
1.0-DBL_EPSILON
1.0-DBL_EPSILON/2.0
1.0
1.0+DBL_EPSILON
all of which are exactly representable in a typical radix-2
implementation. Even if you mean to exclude the endpoints, there
still one additional exactly representable real number within the
range.
You claim to be discussing the fundamental model of floating-point
numbers. You can't reasonably ignore details like this.
and you know nothing better about it without detailed analysis of
the code that set the value.
So examining the value doesn't tell you anything about the value?
Nonsense.
This is one of the reasons using
equality relations in FP is unwise. x < y implies that ALL values
in the x range are less that ALL the values in the y range. The
structure of FP values is such that you can tell this immeditely if
the value stored in x is less than the value stored in y.
When you write out the value in x to umpty-ump digits you are doing
nothing useful. That is simply one of the many possible values
that that x can represent (I am mixing up the usage of value).
Can you express your idea *without* "mixing up the usage of value"?
If you can't explain it coherently, consider the possibility that
you're wrong.
If you start taking differences in values you will find that the
resultant errors can be overwhelmingly due to the original ranges,
which were not errors, but simply unknown details. Differences of
nearly equal quanities, etc. If you use products and quotients,
the resultant error will probably not become excessive. These
differences in resultant errors are what limits inversion of
matrices, etc.
If you take differences or use products and quotients, you're
performing floating-point operations. We all know that such
operations are inexact. The discussion is about stored values, not
operations.
You seem to be claiming that the inaccuracies in a floating-point
calculation (which we both agree exist) are somehow magically but
undetectably retained when the result of the calculation is stored.
They aren't.