John Hauser

“Handling Floating-Point Exceptions in Numeric Programs”

Article by John R. Hauser, published in ACM Transactions on Programming Languages and Systems 18:2 (March 1996), pp. 139–174.
36 pages.

Abstract: There are a number of schemes for handling arithmetic exceptions that can be used to improve the speed (or alternatively the reliability) of numeric code. Overflow and underflow are the most troublesome exceptions, and depending on the context in which the exception can occur, they may be addressed either: (1) through a “brute force” reevaluation with extended range, (2) by reevaluating using a technique known as scaling, (3) by substituting an infinity or zero, or (4) in the case of underflow, with gradual underflow. In the first two of these cases, the offending computation is simply reevaluated using a safer but slower method. The latter two cases are cheaper, more automated schemes that ideally are built in as options within the computer system. Other arithmetic exceptions can be handled with similar methods. These and some other techniques are examined with an eye toward determining the support programming languages and computer systems ought to provide for floating-point exception handling. It is argued that the cheapest short-term solution would be to give full support to most of the required (as opposed to recommended) special features of the IEC/IEEE Standard for Binary Floating-Point Arithmetic. An essential part of this support would include standardized access from high-level languages to the exception flags defined by the standard. Some possibilities outside the IEEE Standard are also considered, and a few thoughts on possible better-structured support within programming languages are discussed.

-> Adobe PDF document, 1996_Hauser_FloatingPointExceptions.pdf.

Notes

Selected responses to reviewer comments

As usually happens, some interesting concerns were voiced during the review of my paper for publication. I have listed below a few selected reviewer comments, followed by the responses I gave at the time. The comments chosen are ones that I disputed and thus were never reflected in the final paper. All the comments I’ve listed actually came from a single particularly astute reviewer. Be aware that the fact that the paper was eventually published does not imply that the reviewer was impressed by my responses (assuming he even saw them).

John Hauser, 2024 September 12