Appropriate optimization

Kearfott Ralph B uunet!usl.edu!rbk5287
Tue May 19 23:24:30 PDT 1992


I have been following with considerable interest the discussion on
optimization of floating point and other expressions, and have felt
it appropriate to express some of my thoughts at this point.

First, George Corliss noted that there are cases in which it would not
be appropriate to optimize expressions involving user-defined data types.  
As an example,
he mentioned that interval values of expressions change, mathematically,
when the expressions are rearranged.  For example, if X is an interval,
then X-X is not equal to zero unless the left and right endpoints of X
are equal.  

However, note that  both X-X and 0 contain the range of the floating point 
expression x-x as x ranges over all values in X, but [0,0] is a much
sharper bound on the range than [min(X)-max(X), max(X)-min(X)] = X-X.
Since, in most cases I am aware of, the intent of the interval arithmetic
is to obtain rigorous bounds on the range of the expression, and sharper
bounds are more useful, optimization of expressions involving overloaded
operators may be appropriate.  (Note that the optimization, at least
in this simple example, is analogous to replacing a floating point
result by one with higher accuracy.)  Please correct me if you have
an example in which such optimization would cause a serious problem.

Perhaps it would be appropriate to supply compiler directives to
allow programmer control of optimization of substructures within
program units.

In another communication, David Stewart mentions that true portable
interval arithmetic libraries are impossible without dynamic control 
of the rounding mode.  I certainly am all for universal language
elements to control the rounding mode.  However, I think the present  
possibilities depend somewhat on what is meant by "portable".  We have
been simulating directed roundings by adding or subtracting small
quantities related to the "maximum number of units in the last place"
by which an elementary op. can be off.  To port from one machine to another,
one replaces certain machine parameters, and assigns a correct
"maximum number of units".  The resulting arithmetic is, I think,
rigorous, but is far from optimal on specific machines from both
the point of view of speed and of accuracy (i.e. widths of resulting
intervals).  Also, it is unclear whether users can easily ascertain
the "maximum number of units in the last place".

I hope this stimulates more friendly discussion.

Baker Kearfott
rbkausl.edu (Internet)




More information about the Numeric-interest mailing list