(j3.2006) Interval arithmetic

Malcolm Cohen malcolm
Tue Mar 17 23:32:32 EDT 2009

Van Snyder wrote:
> The beginning of the problem is that interp f95/000104
No, that is not a problem that affects whether we could or could not 
have done something when we revised the standard.

You keep saying it, but it does not make it more true.  It is still not 
only false, but false by definition and obviously so.

And even disregarding that, the interp would not affect any putative 
user-written interval arithmetic module because that interp deals with 
intermediate results of intrinsic type, whereas the user-written module 
MODE ALL THE TIME.  The interp HAS NO BEARING on inter-statement 

(In fact the standard mostly pretends that inter-statement optimisation 
doesn't exist, though we all do it, hopefully without breaking anything.)

It probably doesn't make it any clearer to write the above in caps, but 
I find it rather frustrating to be repeatedly slapped around the head by 
an out-of-date red herring that I dealt with in an earlier message.
> The standard could solve the problem either by requiring only one
> representation for a particular type and kind, or by requiring that the
> result of a computation be put into the representation of its type and
> kind without any rounding mode changes intervening between those events,
> or by providing an attribute for variables that allows a program to
> specify how values are rounded before being stored into them.
These hammers are *WAY* too big for this alleged "problem", which does 
not (IMO) even arise given the current wording of F2003 in particular 
with the IEEE modules.  Those modules *already* give the precise answer, 
viz the one required by IEEE 754, for (qua the right declarations)
   CALL ieee_set_rounding(ieee_up)
    X%HI = A%HI + B%HI
   CALL ieee_set_rounding(ieee_down)
   X%LO = A%LO + B%LO
which is the kind of code we would be seeing for the user-defined 
implementation of interval-arithmetic "+".  In that example there is no 
intermediate result for interp F95/whatever to be applied to, the red 
herring is not just out of date but completely decomposed.  All us 
implementors know we're not supposed to move computations across a 
statement that changes the rounding mode.

........................Malcolm Cohen.

More information about the J3 mailing list