[OK, the thread has moved on, but since I asked the question I feel I
should acknowledge the answer and comment on it, but feel free to
leave this unanswered if you think it will be neater to follow only
the other subthread.]
For most normal implementations, the range is x*(1-EPSILON) to
x*(1+EPSILON), with special considerations when x is a power of 2.
You need to say what EPSILON is and what special considerations are
needed. Without knowing these things no one can say if your model is
simple or complex, helpful or unhelpful.
Those values are what I call xmax and xmin. They are NOT included
in the range, and thus the range is actually:
xmax > number > xmin
as a condition where number is described by x IN THAT FP
IMPLEMENTATION. The function nextafter() allows the y (where xmax
is a member of the range of y) to be defined. This y is the next
fp implemented value to x, there are none in between. Note that
xmax, number, xmin above are all real values.
Yes, all the ?max ?min numbers are real and x and y are floating point
numbers. Because you are excluding subnormals, I have to use a
modified nextafter which I'll call nextafter'. Given y ==
nextafter'(x, INFINITY) we have: (for positive x)
xmin < x < xmax and ymin < y < ymax
You are saying, I think, that xmax == ymin because if xmax > ymin
there would be overlap and if xmax < ymin there would be
unrepresentable reals. What actually is xmax (AKA ymin)? Is there a
formula for it? Is it just (x+y)/2?
If so, this model is not that different the one in the C standard.
Constants get represented by the closest floating point number.
Simple calculations like 1.0/3.0 are not required to be that accurate
(though they will be if the implementation uses IEEE FP) so I think
your model is rather strict.
I am still not sure why you also want to turn that simple model round
and say that FP values the represent ranges of reals, but that is
another argument and will maybe be clearer when we know what these
ranges actually are.
Presumably the largest and smallest representable floats represent
either no range or some special range defined just for them.
Alos, I think your model is at odds with the rounding behaviour
specified in the C standard, though to be sure you need to say whether
xmax really is (x+y)/2. We really need to know that.
The magic thing
about xmax is that it CANNOT be specified by x, yet it CAN be
specified by y.
I don't know what you are getting at here. x and y specify each other
so how could xmax not be specified by x since y is? Tell us what xmax
actually is and maybe it will be clear why it can't be specified by x.
About 60 years ago I had a professor who hammered at all us
'students' with these concepts involving numbers, reals, integers,
limits, etc. and insisted we learn methods that handled them all.
I have forgotten a good deal of it. He was better at it than I am.
In 1949 the art of floating point arithmetic was in it's infancy. It
is not immediately obvious that a 60 year old model will still be a
good one. I can't yet see any advantage over the simpler model.
And no, I am not including subnormals, NaNs, INFs, etc.
This is a problem because the model in the C standard does include
then, so you have to say something about them if only to say they are
all special cases like DBL_MAX and -DBL_MAX seem to be.
Zero is a
unique thing in floating implementations, necessary because
multiplication (and division) by zero needs to be recognized. We
can't just use the smallest representable normalized real.
What is a normalised real?
Are you saying there is a set of reals close to zero that can't be
represented? That seems to be a significant flaw. If you are not
saying that, why does zero *not* represent the range of reals that get
stored as zero (most of which are non zero) just like the floating
point value 1.0 represents, in your view, a range of values most of
which are not 1?
(And 1 is also often special. IEC 60559 mandates that 1*x == x/1 ==
x and this is often true even on less well specified floating point
implementations.)