Re: A question Re: Level 1 <---> level 2 mappings; arithmetic versus applications
> From: "Nate Hayes" <nh@xxxxxxxxxxxxxxxxx>
> To: "Dan Zuras Intervals" <intervals08@xxxxxxxxxxxxxx>
> Cc: <stds-1788@xxxxxxxxxxxxxxxxx>,
> "Dan Zuras Intervals" <intervals08@xxxxxxxxxxxxxx>
> Subject: Re: A question Re: Level 1 <---> level 2 mappings; arithmetic versus applications
> Date: Wed, 30 Jun 2010 16:42:16 -0500
>
> Dan Zuras wrote:
> >>
> >> . . .
> >>
> >
> > Level 1 is the set of all possible contiguous subsets
> > of the extended Reals.
> >
> > Therefore there ARE NO mid-rad or inf-sups at level 1.
> > Representations have no meaning there.
> >
> > Level 2 is some finite subset of the intervals that exist
> > at level 1.
> >
> > What I am proposing is that the DEFINING characteristic
> > of that subset be that the bounds be exactly (some say,
> > losslessly) extractable as elements of some floating-point
> > type F.
> >
> > Therefore, there are no mid-rad or inf-sups at level 2
> > either. Representations have no more meaning here then
> > they do at level 1.
> >
> > All the formats live at lower levels.
> >
> > And I am proposing an approach that never speaks of them
> > directly while still knowing that they exist & taking
> > care that some agreeable behavior is possible for them.
> >
> > That's all.
>
> It all hangs together for me until mention of extracting bounds of the Level
> 2 interval losslessly as a floating-point number. I don't see how a mid-rad
> implementaiton (or even some of the other examples you gave) could conform
> to that.
>
> Sorry to be a buzzkill, but I guess I'm a little lost.
>
> I think I'm just going to shut-up and listen...
>
> Nate
Nate,
I have proposed a method several times now but I will
state it once again, narrowly expressed to address your
concern.
I propose that we define the set of level 2 objects by
the exact (or lossless) extraction of bounds into some
floating-point type F.
What does that mean for level 3 things & below about
which I want to say nothing, if possible, in the
standard itself?
Well, if you choose some sort of inf-sup form, it is
pretty trivial. Just copy (or negate, as the case may
be) one of your stored bounds & give it to the user.
What about mid-rad forms?
Well, if we are storing both mid & rad in floating-point
(even if they are of different precisions, either from
each other or from F) it is certainly true that there
are more values of mid + rad available to us than there
are elements of F. Well, more than for any REASONABLE
precision of F, that is.
Therefore, the restriction that the set be defined by
the exact (lossless) extraction of bounds means we will
have to LIMIT those mid x rad pairs we recognise as
elements to only those that CAN BE added such that
mid + rad is exactly an element of F.
It sounds complicated but its not, really. If I have
a Real level 1 interval for which the Real midpoint is
midR & the Real radius is radR, I can use the subset of
mid-rad elements defined by the assignments
mid <-- roundToNearest(midR)
rad <-- roundAway(mid + radR) - mid.
Not all mid-rad pairs have the property that they can
be summed to an element of F exactly, but THIS SUBSET
of the mid-rad pairs DOES have that property, by
construction.
Now, this is not the only way.
There is a more robust form of the rad assignment
rad <-- maxAbs(roundAway(mid + radR) - mid,
roundAway(radR - mid) + mid)
but I think that may be overkill. I'm not sure.
And it doesn't solve everything.
It will often return an interval that is slightly wider
than would be returned in an inf-sup form but only by
an ULP on one side or the other. This will piss off
the inf-sup guys who want narrowest interval uber alles
(no nationality dig intended :-) but it is the price of
freedom from concern about the nature of the format.
And you have to take some more care around fairly wide
intervals, in which (|mid| + |rad|)/|mid| > b (where b
is your base) since when you cross a power of your base
the size of an ULP changes.
And you have to take more care for intervals wide enough
to include zero (|rad| > |mid|) in which case it is mid
that gets rounded funny rather than rad.
And, of course, we have to figure out some breakout for
semi-infinite intervals. I have one in mind involving
decorations for infinite intervals that would work for
both mid-rad & inf-sup.
But all these things can be taken into account.
Perhaps even in hardware, now that I come to think of
it.
So THIS is how you recover bounds losslessly from a
mid-rad form. You make sure to deal with only that
subset of elements for which lossless recovery is
possible.
It is a bit of a burden, I agree.
But if the mid-rad guys give us this for the sake of
'not lying to the user' & the inf-sup guys give us an
ULP to let them do it, both sides can be made to
conform with minimal (but non-zero) pain on each side.
Have I made the plan clear now?
Are there any more questions or doubts that it can be
done?
Deciding whether or not it is the RIGHT thing to do
is really up to you.
Yours,
Dan