Re: Table 4 proposal version 0.2...
On 2012-03-17 21:24:46 +0000, John Pryce wrote:
> On 5 Mar 2012, at 02:10, Vincent Lefevre wrote:
> > BTW, I think that P1788 should allow non-FP formats (e.g.
> > double-double and rational arithmetics). Requirements could
> > be at least: the number of values is finite, the format is
> > symmetric (-x is exact), and +inf, -inf and NaN are available.
>
> I think this is an excellent suggestion. As we're seeing, the
> interface of intervals to floating point is necessary but
> contentious. Since, early on, we rejected tying P1788 exclusively to
> IEEE 754, we need some ground rules like this. Vincent's rules are
> *necessary* properties to my philosophy of how we create this
> interface, except for "-x is exact", which is sensible rather than
> necessary.
>
> Vincent, will you propose a motion about it?
I'll try to do that for next week.
> I suggest another couple of things:
> - There be at most two flavours of zero, and that in
> comparison relations they behave as in 754.
> (E.g. -0 == +0 returns true.)
In general, this should be out of the scope of P1788 (what is a flavour
may be tricky to define... think of the cohorts in the IEEE 754 decimal
FP formats, for instance), but since we require +inf and -inf, the
concept of signed zeros should be taken into account. IMHO, we should
define the behavior when zero is signed (with a -0 and a +0), and let
it implementation-defined otherwise (the case of a single zero is
unambiguous anyway).
> - Doing (+inf)-(-inf) shall return +inf.
I think that operations on numbers should be out of the scope of
P1788. Remember that P1788 specifies a behavior, but doesn't define an
implementation, and I don't think we need (+inf)-(-inf) = +inf here.
IMHO, the only thing we need is a well-specified order (mostly to
define -inf and +inf), where -inf < any real number < +inf.
> Dan mentioned there is/was an arithmetic that doesn't
> do this; we shall not make allowances for it.
What does it do? (Note that the user/library still has the possibility
to override the default behavior.)
> How does double-double work? Must the two pieces have disjoint
> exponent ranges, so there is only one way to represent a nonzero
> number?
I would say that this depends on the implementation. It may just
require that the second component be less than 2^(-p) times the
first component, and this still allows different representations.
On the contrary, the implementation may require that numbers are
"normalized"; this can be done with TwoSum or FastTwoSum, depending
on the context.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)