Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Version 2.11, Proposal for interval standardization



[Bo, this is the same attachment as the one which I had already sent
to you in my second reply; after having seen that I didn't reach
the whole list, I rewrote my reply.  AN.]


Bo Einarsson wrote:
I have noted some typos, but also some more important comments
on the proposal (sections 1.3 and 1.5) which are of interest
not only to the editor, and might arise discussion.

Section 1.3 In IEEE 754 NaN:s are not unique, and from
P 754 Section 5.11, line 6: Every NaN shall compare unordered with
everything, including itself.

I therefore recommend the following rewrite of (iv)

(iv) l = NaN and u = NaN (empty interval Empty).

yes.


Section 1.5 Logical functions are discussed here, and seem to be
in the C style with values 0 and 1 instead of Fortran or Algol
TRUE and FALSE.

Yes, for brevity,


Item 7. In my opinion areEqual(xx,yy) should return TRUE
if xx and yy are the same set, and areDistinct(xx,yy) should return
FALSE in that case. I do not like the the word "under the same
cirumstances", it is better in a standard to repeat exactly what
is valid.

OK.


John Pryce wrote:

> Bo Einarsson has found all of the typos I have so far. Except surely your "intpov"
> should be "intpow" everywhere?

yes.


> And I think you have xx-zz that should be zz-xx in the definition of inner
> addition.

Intended was
     widest interval zz such that zz-yy subset xx
and similarly for inner subtraction.
(This might change again at a later stage when it is more clear
what is needed to accommodate modal interval arithmetic.)

Also, the definition of the 2-valued sign in Section 4.1 was gobbled up.
(The whole Section 4 is still in a somewhat imperfect state.)


Attached is a corrected version 2.11 reflecting all changes mentioned
by Bo and John, and correcting a few additional misprints.

The list of differences to Version 2.0 (generated by the unix
command diff) is given below.


Arnold Neumaier



=======================================================================

7c7,10
<                   Version 2.11 from 10.11.2008
---
>                   Version 2.0 from 04.11.2008
>
>           (superseding Version 1.0 from 24.09.2008)
>
9,11d11
< [Compared to version 2.0, a few misprints are corrected, in a few
< places, the wording was made more precise, and the definition of
< the 2-valued sign in Section 4.1 was changed to what was intended.]
87c87
< Thus if there are floating-point numbers +0 and -0 both with value 0
---
> Thus if there are floating-point numbers +0 and -0 both woth value 0
89c89
< may choose to represent the interval [-0,inf] as [+0,inf].
---
> may consider to represent the interval [-0,inf] as [+0,inf].
98c98
<  (iv) l = NaN and u = NaN (empty interval Empty).
---
>  (iv) l = u = NaN (empty interval Empty).
125d124
< Here for brevity 1 = true, 0 = false.
150,151c149
< depending on whether or not the intervals xx and yy represent the
< same set.
---
> under the same circumstances.
195c193
< This section is a discussion version only, without a full syntax
---
> This secition is a discussion version only, without a full syntax
225c223
< <decimal>-nonneg> and <decimal>+<nonneg>.
---
> <decimal>-<nonneg> and <decimal>-<nonneg>.
255c253
< floating-point number followed and/or preceded by optional blanks,
---
> floating-point number followed and/or preced by optional blanks,
273c271
< This facilitates the accurate enclosure of exact values of compound
---
> This facilitate the accurate enclosure of exact values of compound
323c321
< arithmetic operations. An implementation is standard-conforming
---
> arithmetic operations. An implementation is standard-cornforming
402c400
<      intpow          xx^k      (see 3.7)          accurate  reverse
---
>      intpov          xx^k      (see 3.7)          accurate  reverse
497c495
< allowed to be an interval, intpowinv2 does not exist, and
---
> allowed to be an interval, intpovinv2 does not exist, and
501c499
<    [0,1] intpowhull -2 =  [0,inf]   and     [0,1] povhull -2 = [0,inf];
---
>    [0,1] intpovhull -2 =  [0,inf]   and     [0,1] povhull -2 = [0,inf];
503,504c501,502
<    [-1,1] intpowhull 3 = [-1,1]    while    [-1,1] povhull 3 = [0,1];
<    0 intpowhull 0 = 1              while    0 povhull 0 = empty.
---
>    [-1,1] intpovhull 3 = [-1,1]    while    [-1,1] povhull 3 = [0,1];
>    0 intpovhull 0 = 1              while    0 povhull 0 = empty.
508c506
< operation root implementing x^(1/q) for x>0 and a positive integer q.
---
> operation root implemnting x^(1/q) for x>0 and a positive integer q.
513c511
< 1. The above guarantees that the result of arithmetic operations
---
> 1. The above guarantees that the result of arithmeitc operations
549c547
<       sign2([l,u]) = {-1 if 0>l<=u<=0, 1 if 0<=l<=u>0, NaN otherwise}
---
>       sign2([l,u]) = {-1 if l<u<=0, 1 if l>u>=0, NaN otherwise}
557c555
< comparisons <, <=, >, >= (3-valued?)
---
> comparisons <, <=, >, >= (3-valued?
567,568c565,566
< inner addition (widest interval zz such that zz-yy subset xx)
< inner subtraction (widest interval zz such that zz+yy subset xx)
---
> inner addition (widest interval zz such that xx-zz subset yy)
> inner subtraction (widest interval zz such that xx+zz subset yy)
667c665
< of interval arithmetic as long as in rounding mode up (down), the
---
> of interval arithmetic as long as in rounding mode pu (down), the
681,684c679,682
< (i)  For circ = / and l' < 0 < u', [l,u] not [0,0]
<      we must have l''=-inf, u''=inf,
< (ii) For circ = / and [l',u'] = [0,0],
<      we must have l''=NaN, u''=NaN.
---
> (i) For circ = / and l' < 0 < u', [l,u] not [0,0]
>     we must have l''=-inf, u''=inf,
> (i) For circ = / and [l',u'] = [0,0],
>     we must have l''=NaN, u''=NaN.



              Proposal for interval standardization

                         Arnold Neumaier
  
                  Version 2.11 from 10.11.2008

[Compared to version 2.0, a few misprints are corrected, in a few
places, the wording was made more precise, and the definition of 
the 2-valued sign in Section 4.1 was changed to what was intended.]


Part 0. Prelude
---------------


This is a semiformal document written in a form that should be not 
too difficult to transform into a formal, complete and fully precise 
document specifying the standard to be.

I took into account all contributions to the discussion on the
mailing list that I received before 04.11.2008, 10:00 local time.

I believe that, apart from the issues about treating infinity, 
where this proposal takes the stand of 
- having +-infinity not as member of any interval, and 
- to convert a floating-point +-infinity to the empty interval, 
there are no serious obstacles to an ultimate agreement on a more 
polished, corrected, and upgraded version of this proposal.

Care has been taken to make the bulk of the proposed standard 
independent of the arithmetical properties of floating-point numbers.
However, Part 6 indicates the properties of directed rounding 
that would facilitate implementation.


Of course, all points are open to discussion and alteration.
Some of the items proposed here (e.g., the tightest enclosure of the 
inner product of two vectors of floats in Part 4) have not yet been 
discussed on the list.

    Gut Ding will Weile haben - good things need their time
        http://dict.leo.org/
        Haste makes waste.
        http://www.dict.cc/german-english/Gut+Ding+will+Weile+haben.html
        Rome wasn't built in a day.
        Soon ripe, soon rotten.
        http://www.gho-englisch.de/Resources/proverbs.htm
        Learn to say before you sing.
        dictionary.reverso.net/german-english/Ding%20%7B1%7D
        It takes time to do a thing well




Part 1. Representation and semantics
------------------------------------


1.0. This part defines the representation and semantics of intervals,
regarded as machine representations of uncertain real numbers.
The possible values are required to form a subset of the closed and 
connected set of real numbers represented by the interval. 


1.1. Assumptions about floating-point numbers.
The floating-point numbers representable on a particular machine 
form a finite set. There is a partial mapping value from F to 
R^* = R union {-inf,+inf}, the order completion of the set R of real 
numbers. 

NaN, -inf, +inf, and 0 denote any floating-point number
x such that value(x) is undefined, -inf, +inf, and 0, respectively; 
it is assumed that such floating-point numbers exist.
inf and +inf are used synomymously.


1.2. An interval [l,u] is represented by two floating-point numbers l, 
called the lower bound, and u, called the upper bound. 

Two intervals are regardes as equal if the values of the lower bounds 
agree and the values of the upper bounds agree, otherwise as distinct.
Which of the equivalent representations of an interval is used may
depend on the implementation. 

Thus if there are floating-point numbers +0 and -0 both with value 0
then [-0,inf] and [+0,inf] are equal. However, an implementation 
may choose to represent the interval [-0,inf] as [+0,inf].
(This is relevant for the considerations in Part 6.)


1.3. A standard interval has the form [l,u], where one of the following 
holds:
  (i) Both bounds are finite, and l <= u.
 (ii) One bound is finite, and l = -inf or u = +inf.
(iii) l = -inf and u = +inf (entire interval Entire).
 (iv) l = NaN and u = NaN (empty interval Empty).
A standard interval [l,u] represents in case (i)-(iii) the set 
(equivalently an arbitrary number from the set) of all real numbers x 
with value(l) <= x <=  value(u), and in case (iv) the empty set
(equivalently, no number).

In particular,
- standard intervals describe closed and connected sets of real 
  numbers, including the empty set [NaN,NaN] and the set [-inf,inf] 
  of all reals;
- floating-point bounds with value 0, +inf, -inf, or NaN have the 
  same meaning in standard intervals independent of their 
  representation;
- bounds with denormalized numbers are valid bounds for standard 
  intervals;
- +inf, -inf, and NaN are not members of any standard interval;
- standard intervals do not represent closed disconnected sets such 
  as [-inf,-1] union [1,inf]. 


1.4. An interval [l,u] is nonstandard if it is not a standard interval.
No specification is made for the meaning of nonstandard intervals.

In particular, [-inf,-inf] and [+inf,+inf] are nonstandard intervals.


1.5. Operations checking the semantics.
Here for brevity 1 = true, 0 = false.

1. There is an operation isStandard(xx) that outputs 0 or 1 
depending on whether or not the input interval xx is standard.

2. There is an operation standard(xx) that outputs xx if xx 
is standard, and the empty interval otherwise.

3. There is an operation isEmpty(xx) that outputs 0 or 1 
depending on whether or not the interval xx is empty.

4. There is an operation isEntire(xx) that outputs 0 or 1 
depending on whether or not the interval xx is [-inf,+inf].

5. There is an operation standardInterval(l,u) that returns the 
interval [l,u] from two floating-point numbers l and u if it is 
standard, and Empty otherwise.

6. There is an operation anyInterval(l,u) that creates the 
interval [l,u] from two floating-point numbers l and u without
checking whether or not it is standard.

7.  There is an operation areEqual(xx,yy) that outputs 1 or 0 
depending on whether or not the intervals xx and yy represent the 
same set, and an operation areDistinct(xx,yy) that outputs 0 or 1
depending on whether or not the intervals xx and yy represent the 
same set.

8. There is an operation isIn(x,xx) or an operation contains(xx,x)
that outputs 0 or 1 depending on whether or not the float x is in 
the standard interval xx.
The behavior for a nonstandard interval xx is not specified.

In particular, isIn(x,xx) returns 0 when x is +-inf and the interval 
is standard. 


1.6. Scope of operations.
All operations with interval input shall be defined both for standard
and for nonstandard intervals, and all operations with interval output 
shall allow both standard and nonstandard intervals as output.

All operations with interval output shall have standard intervals as 
output if all interval inputs are standard intervals.

With the exception of the operations listed in Section 1.5,
the standard makes no specification for the result of operations 
involving some non-standard interval since there are several mutually 
conflicting extensions of the interval calculus interpreting 
[l,u] for l>u, including those which interpret them either as 
Kahan-style intervals (complements of open intervals) 
or as Kaucher-style intervals (involving ideal objects that allow
to define the inverse operation for addition).


1.7. In the remainder of this document, all intervals will be 
assumed to be standard intervals (rather than nonstandard intervals 
or intervals in the mathematical sense).




Part 2. Text to interval conversion
-----------------------------------

2.0. This part defines which texts denoting a mathematical definition 
of an exact or uncertain real number shall be convertible into a 
standard interval guaranteed to contain any valid interpretation of 
this number.

This section is a discussion version only, without a full syntax 
specification; instead, it proceeds by examples.


2.1. There is an operation interval(t) which returns for a given 
text t an interval containing a valid enclosure of all real numbers 
matching the definition given in the text according to the rules given 
in Sections 2.2-2.6 (cf. also 2.8) and raises a flag nonstandardNumber 
if the text cannot be interpreted by these rules. It may also raise 
additional implementation-dependent flags. 


2.2. Textbook intervals.
Texts t taking one of the forms 
    '[<decimal>,<decimal>]',  '[<decimal>,<+inf>]',
    '[<-inf>,<decimal>]',     '[<-inf>,<+inf>]',
where <decimal> is as before, <+inf> is a representation for +inf,
and <-inf> is a representation for -inf [both to be specified], 
is considered to be an interval, and is required to be converted 
by interval(t) into the tightest interval containing this interval.


2.3. Centered intervals.
A text t taking the form  
    '<<decimal>,<nonneg>>'
    '<decimal>+-<nonneg>'
where <decimal> is as before, <nonneg> is a nonnegative <decimal>,
and the outer pointed brackets denote these as characters,
is considered to be an interval, and is required to be converted 
by interval(t) into the tightest interval containing the numbers
<decimal>-nonneg> and <decimal>+<nonneg>.


2.4. Uncertain numbers.
A text t taking one of the forms  
    '<fixpart>?<expart>',  '<fixpart>_<expart>',
    '<fixpart><unctype><fixpart><expart>',
where <fixpart> is a <decimal> without exponent part, <expart>
is a possibly empty exponent part, and <unctype> is one of the 
characters in '?udar', is considered to be an uncertain number,
and is required to be converted by interval(t) into the tightest 
interval containing the real value of this interval.  [to be described]


Examples:
(ulp is one unit in the last place of the decimal number displayed)
12.3_ # represents 12.3 +- 1 ulp, i.e., [12.2,12.4]
12.3? # represents 12.3 +- 1/2 ulp, i.e., [12.25,12.35]
    Note: An earlier version had here erroneously 1 ulp
12.3?5 # represents 12.3 +- 5 ulp, i.e., [11.8,12.8]
.23?u2 # represents .23 + <=2 ulp, i.e., [.23,.25]
.23?d2 # represents .23 - <=2 ulp, i.e., [.21,.23]
.23?a0.1 # represents .23 +- 0.1, i.e., [.22,.24]
.23?r0.1 # represents .23 * (1+-0.1), i.e., [.207,.253]


2.5. Exact numbers.
A text t taking one of the forms  
    '<decimal>' or '<decimal>x', 
where <decimal> stands for a finite, arbitrary precision decimal 
floating-point number followed and/or preceded by optional blanks, 
is considered to be an exact number, and is required to be converted 
by interval(t) into the tightest interval containing this number.

Texts with the suffix x are allowed to ensure maximal compatibility 
with user defined literals in the future C++0x standard.


2.6. Exact expressions.
A text t taking the form of an arithmetic expression in the
operations from Section 3.1, 3.3, 3.5, and 3.7 below,
containing no variables but only constants of the form  
'<decimal>' or '<decimal>x', is considered to be an exact expression, 
and is required to be converted by interval(t) into an interval 
containing this number, at least as tight as if the corresponding
computation would have been done by converting each of the constants to
intervals and then performing the corresponding interval operations.

This facilitates the accurate enclosure of exact values of compound 
expressions such as 
   goldenratio = (1+sqrt(5))/2,
   12345678901234567890/9876543210987654321,
   1/(1-1/(1-1/(1-1/(1-1/(1-1/(1-1/123456789)))))), 
   pi = 4*arctan(1), etc.

The list of operations in the above conversion specification should 
of course coincide with the list of operations where the standard 
specifies the interval meaning, together with additional 
standard-conforming unary operations which a particular implementation 
provides.

In particular, (whether or not atan is in the mandatory list
of unary operations) one should recognize both strings
'4*atan(1)' and '4*arctan(1)' and get a valid enclosure for pi
returned.


Remark:
In the future C++0x standard, conversion according to Section 2.1-2.5
could be done via user defined literals
     http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf

Thus exact numbers 2, 0.1, and 1e400 can be encoded as 
    2x, 0.1x, 1e400x, etc.
and intervals as 
    "[0.1,0.2]"i,   ".23?r0.1e-5"i,  etc.
The conversion of exact expressions (Section 2.6), however, 
should always be done by an explicit constructor.


2.7. Interval to text conversion.
There is an operation text(xx) which returns for a given interval xx
a text t conforming to the above requirements such that interval(t)
contains xx, with bound deviating from the bounds of xx by at most 
one unit in the last place.


2.8 There must also be a way of converting an interval to text in a way
that allows to reconvert back the text to retrieve the original 
interval. Hexadecimal in/out?



Part 3. Arithmetic operations
-----------------------------

3.0. This part specifies the behavior of arithmetic operations either
required by the standard, or of further implementation-depending
arithmetic operations. An implementation is standard-conforming 
only if all required and all its implementation-dependent arithmetic
operations conform to the requirements below.


3.1. Interval arithmetic operations are implemented in one of three 
accuracy modes, 'tightest', 'accurate', or 'valid'. An operation
may be implemented in any accuracy mode if only 'valid' is required, 
in the accuracy modes 'tightest' or 'accurate' if 'accurate' is 
required, and must be implemented in the accuracy mode 'tightest'
if 'tightest' is required.


3.3. The hull of a set of real numbers refers to an interval (in the 
sense of this standard) containing the set, with the additional 
property that:
1. in accuracy mode 'tightest', the interval is the tightest interval
containing the set.
2.  in accuracy mode 'accurate', the interval is contained in 
the tightest interval containing all sets obtained from arguments 
whose Hausdorff distance from the inputs is at most one ulp
of the corresponding inputs. 
3.  in accuracy mode 'valid', no further requirement is imposed.


3.4. There is a function accuracy(s) that outputs for each arithmetic 
constant, unary operation, or binary operation with name passed as 
string the actually implemented accuracy mode (which may be tighter 
than required), or 'not implemented' if the string does not represent
an implemented operation. This information should also be available
at compile-time.


3.5. Continuity test.
For every unary or binary operation which is not everywhere continuous,
- the possiblyUndefined flag must be raised when the operands contain 
  values for which the operation is not defined  (or not a finite real 
  number), and 
- the possiblyDiscontinuous flag must be raised when the operands 
- contain values for which the operation is either discontinuous or 
  not defined (or not a finite real number).

This is necessary in order to correctly infer validity and continuity 
of function evaluation, which is indispensible for the application of 
existence theorems.


3.6. Table: Arithmetic constants.
     pi            4*atan(1)
     twopi         8*atan(1)
     pihalf        2*atan(1)
     e             exp(1)
     goldenratio   (1+sqrt(5))/2,
     Empty         [NaN,NaN]
     Entire        [-inf,inf]
and implementation-dependent arithmetic constants.


3.7. For each mathematical constant from Table 3.8,
there is a nullary operation resulting in the tightest interval 
containing this constant. 


3.8. Table: Unary arithmetic operations. 
The first column gives the name, the second its use in expressions, 
the third the minimal accuracy requirement, the fourth whether a 
reverse mode is required.
     unary minus     - xx                         tightest  
     square          sqr(xx), xx^2                tightest  reverse
     inverse         inv(xx), 1/xx                tightest  reverse  
     abs             abs(xx)                      tightest  reverse  
     sign            sign(xx) (3-valued)          tightest  
     ceiling         ceil(xx)                     tightest  
     floor           floor(xx)                    tightest  
     sqrt            sqrt(xx)                     tightest  
     exp             exp(xx)                      tightest  
     log             log(xx), ln(xx)              tightest  
     log10           log10(xx)                    tightest  
     log2            log2(xx)                     tightest  
     intpow          xx^k      (see 3.7)          accurate  reverse
     ratpov          xx^(p/q)  (see 3.7)          accurate  reverse
     sin             sin(xx)                      accurate  reverse
     cos             cos(xx)                      accurate  reverse
     tan             tan(xx)                      accurate  reverse
     sinh            sinh(xx)                     accurate  
     cosh            cosh(xx)                     accurate  reverse
     tanh            tanh(xx)                     accurate  
     asin            asin(xx), arcsin(xx)         accurate       
     acos            acos(xx), arccos(xx)         accurate         
     atan            atan(xx), arctan(xx)         accurate        
     asinh           asinh(xx), arsinh(xx)        accurate
     acosh           acosh(xx), arcosh(xx)        accurate
     atanh           atanh(xx), artanh(xx)        accurate
and implementation-dependent unary arithmetic operations with arbitrary 
accuracy mode. 

Suggested further unary operations (forward mode only; relevant for
constructing optimal linear and quadratic underestimators):
   exp2(x) := (e^x-1-x)/x^2
   sin2(x) := (sin(x)-x)/x^2
   cos2(x) := (cos(x)-1)/x^2
   sinh2(x) := (sinh(x)-x)/x^2
   cosh2(x) := (cosh(x)-1)/x^2
extended by continuity to x=0.


3.9. For each (partial) unary operation phi from Table 3.8, 
there is a unary forward interval operation phih (''phi hull'')
defined by
   phihull(A) = hull of the set of phi(a) with a in A
                        such that phi(a) is defined and finite,
and, if required, 
a binary reverse interval operation phiinv defined by
   phiinv(C,X) =  hull of the set of x in X for which
                        phi(x) is defined, finite, and in C.
Here the second argument is optional, with default X=[-inf,inf] if
absent.  

Note that inverse functions available as standard functions are 
unary operations in their own right, with the usual definition. 
Thus there will be a sqrthull in addition to sqrinv, and
    sqrthull(9)=3,    while    sqrinv(9)=[-3,3].


3.10. Table: Binary arithmetic operations, except power. 
     +         xx + yy                      tightest
     -         xx - yy                      tightest
     *         xx * yy                      tightest  reverse
     /         xx / yy                      tightest  reverse
     max       max(xx,yy)                   tightest  
     min       min(xx,yy)                   tightest  
     pow       xx^yy         (see 3.7)      accurate  reverse
     atan2     atan2(xx,yy)                 accurate  reverse
and implementation-dependent binary arithmetic operations with 
arbitrary accuracy mode. 


3.11. For each (partial) binary operation circ from Table 3.10, there
should be a binary forward interval operation circh (''circ hull'')
defined by
   A circhull B = hull of the set of a circ b with a in A and b in B,
                       such that a circ b is defined and finite.
and, if required, 
two ternary reverse interval operations circinv1 and circinv2
defined by
   circinv1(B,C,X) =  hull of the set of x in X for which b in B exists
                      such that x circ b is defined, finite, and in C,
   circinv2(A,C,X) =  hull of the set of x in X for which a in A exists
                      such that a circ x is defined, finite, and in C.
Here the third argument is optional, with default X=[-inf,inf] if
absent. 

If circ is commutative then circinv1 and circinv2 agree and may be
implemented simply as circinv.

[There is no need to spell out in the standard the mathematical 
proposition which translates the above specification into tables with 
formulas for the end points. These formulas, if desired, can be put 
into an appendix, for all functions where someone is willing to 
provide explicit formulas. It would be more useful to provide sample 
implementations of a subset of the standard.]


3.12. Power operation.
The binary operation pow, 
   where a pow b is defined for nonnegative a and real b, 
   provided that b is positive when a is zero
must be complemented by a binary operation intpow, 
   where a intpow b is defined for real a  and integer b, 
   provided that b is nonnegative when a is zero.
In particular, 0 pow 0 is undefined, while 0 intpow 0 = 1.

The operation intpow should, however, be viewed as a family of unary
operations parameterized by the exponent; thus the exponent is not
allowed to be an interval, intpowinv2 does not exist, and
intpowinv = intpowinv1 although the operation is not commutative.

For example,
   [0,1] intpowhull -2 =  [0,inf]   and     [0,1] povhull -2 = [0,inf];
but
   [-1,1] intpowhull 3 = [-1,1]    while    [-1,1] povhull 3 = [0,1];
   0 intpowhull 0 = 1              while    0 povhull 0 = empty.

We may also consider a ternary operation ratpow implementing
x^(p/q) for x>0, integer p, and positive integer q, or a binary
operation root implementing x^(1/q) for x>0 and a positive integer q.


Remarks. 

1. The above guarantees that the result of arithmetic operations 
with standard intervals is again a standard interval.

2. Overloading arithmetic expressions for interval arguments 
is always done by using the forward hull; in particular this applies to 
the evaluation referred to in Secxtion 2.6.

3. Should all above operations be required, or should there be levels 
of conformance to the standard, with level 1 only catering for the
most basic functionality?




Part 4: Non-arithmetic operations 
---------------------------------


4.0. This section defines nonarithmetic operations whose input or 
output involve intervals.

At present, only rough information is provided.
Details on definition, correct rounding, behavior for infinite bounds, 
etc. are not yet specified and may need discussion.


4.1. Floating-point valued unary operations on intervals: 
   inf (lower bound)
   sup (upper bound)
   mid (midpoint)
   smallest (closest point to zero)
   diam, width (diameter = width)
   rad (radius)
   mag (magnitude = largest absolute value)
   mig (mignitude = smallest absolute value)
   sign2 (2-valued sign)
      sign2([l,u]) = {-1 if 0>l<=u<=0, 1 if 0<=l<=u>0, NaN otherwise}


4.2. Boolean valued binary operations on intervals: 
containment  
proper containment
interior containment
disjointness  
comparisons <, <=, >, >= (3-valued?)


4.3. Floating-point valued binary operations on intervals:  
Hausdorff distance 


4.4. Interval-valued binary operations on intervals:  
hull of union of xx and yy
intersection of xx and yy
inner addition (widest interval zz such that zz-yy subset xx)
inner subtraction (widest interval zz such that zz+yy subset xx)


4.5. Division with gap; returns xx/yy and a gap. 
The gap is the subinterval whose interior cannot be realized as 
quotient x/y with x in xx, y in yy in case 0 is in the interior of yy, 
and Empty otherise.

Similarly perhaps inverse with gap and inverse 
trigonometric/hyperbolic functions with gaps.


4.6. Interval-valued optimal enclosure of a scalar product of two 
floating-point vectors.





Part 5: Mixed operations
------------------------

5.0. This part specifies the conversion of numbers to intervals and the
behavior of mixed arithmetic operations with an interval and a 
noninterval argument. These are important since they are often much 
faster than full interval operations.

If the user means by an integer or floating-point number anything 
different from what its value actually is, the user is required to 
pass the exact definition of the intended number as text.


5.1. There is an operation interval(x) that converts a 
floating-point number x or an integer x to the interval [x,x]
if x is finite, but to the empty interval if x is infinite or NaN.
In the latter case the nonstandardNumber flag is raised.

I expect that the flag will never be inspected, except for debugging 
purposes. Since empty will usually propagate very fast through complex 
calculations, this is the cheapest way to handle problems with inf.

This ensures that 
   xx = interval(x)  implies  isIn(x,xx)=isEmpty(xx).

5.2. Binary arithmetic operations with an interval argument and an 
integer, floating-point, or text argument should give the same result 
as if a prior conversion of the noninterval according to Section 2.1 
or 5.1 had been performed.


5.3. There are binary operations which take as input 
floating-point numbers or integers and return as output the 
tightest enclosure of the exact result of the operation if it is 
a real number, and the empty interval otherwise.


5.4 Some non-arithmetic operations, in particular the hull
may also deserve overloading.





Part 6: Useful directed rounding properties
-------------------------------------------

6.0. This section describes desirable properties of floating-point
operations under directed rounding, which facilitate the implementation
of the proposed standard.

In this part we assume that floating-point numbers are represented 
according to the IEEE 754R standard. Listed are desirable deviations 
from the standard behavior of operation; these deviations are 
restricted to the rounding modes
- up = roundTowardPositive and 
- down = roundTowardNegative.


6.1. Operations (including min and max) with a result having the 
value 0 should represent the result as +0 in rounding mode up, 
and as -0 in rounding mode down.


6.2. The product of a number with value 0 and a number with value 
+-inf should have the value +0 in rounding mode up, and -0 in rounding 
mode down. 


6.3. The result of the division of a number x by +0 should be
NaN if x is NaN, +inf if x>0, -inf if x<0, and if x=0 then
+0 in rounding mode up, and -0 in rounding mode down. 


6.4. The result of the division of a number x by -0 should be
NaN if x is NaN, -inf if x>0, +inf if x<0, and if x=0 then
+0 in rounding mode up, and -0 in rounding mode down. 


6.5. Disabling denormalized numbers is harmless for most applications 
of interval arithmetic as long as in rounding mode up (down), the 
computed result is greater (smaller) than or equal to the result 
obtained in exact arithmetic.

If these deviations are realized, and bounds l=0 are represented by +0,
bounds u=0 are represented by -0, then for circ in {+,-,*,/}, 
   [l,u] circ [l',u'] =  [l'',u'']
with
   l'' = min(l circ l', l circ u', u circ l', u circ u'} 
         in rounding mode down,
   u'' = max(l circ l', l circ u', u circ l', u circ u'} 
         in rounding mode up
will give the correct results in all cases with two exception:

(i)  For circ = / and l' < 0 < u', [l,u] not [0,0]
     we must have l''=-inf, u''=inf,
(ii) For circ = / and [l',u'] = [0,0], 
     we must have l''=NaN, u''=NaN.

(I hope I didn't forget any case.)