Interval Arithmetic: from Principles to Implementation

Interval Arithmetic: from Principles to Implementation

Interval Arithmetic: from Principles to Implementation T. Hickey, Q. Ju M.H. van Emden Department of Computer Science, Brandeis University, USA Department of Computer Science, University of Victoria, Canada Abstract indicates success. A wide interval does not prove that a con- ventionally computed result is wrong, but it does indicate a We start with a mathematical definition of a real interval risk. as a closed, connected set of reals. Interval arithmetic op- When evaluating expressions in interval arithmetic, the erations (addition, subtraction, multiplication and division) interval result tends to be disappointingly large. This is due are likewise defined mathematically and we provide algo- partly to its conservative nature: the result has to contain rithms for computing these operations assuming exact real all possible values, including those where rounding errors arithmetic. Next, we define interval arithmetic operations combine in an unfavourable way. But the main cause of on intervals with IEEE 754 floating point endpoints to be wide intervals is that interval arithmetic does not identify sound and optimal approximations of the real interval oper- different occurrences of the same variable. Because it treats ations and we show that the IEEE standard’s specification of these as if they were unique occurrences, the result is much operations involving the signed infinities, signed zeros, and wider than one could reasonably expect. the exact/inexact flag are such as to make a correct and Interval arithmetic has the property of correctness: result optimal implementation more efficient. From the resulting intervals are guaranteed to contain the real number that theorems we derive data that are sufficiently detailed to con- is the value of the expression. Implementations can only vert directly to a program for efficiently implementing the realize this potential by rounding floating-point operations interval operations. Finally we extend these results to the in the right direction. In the early days such code was not case of general intervals, which are defined as connected sets portable, if rounding direction could be controlled at all. In of reals that are not necessarily closed. addition, in the early days of interval arithmetic, the extra demands of interval computation on the processor and on memory (several operations instead of one; two numbers to 1 Introduction be stored instead of one) posed serious problems. The utility of interval algorithms has shifted over time One of the earliest lessons of digital numerical computation from automatically performing rigorous error analysis to was that, although most programs give highly accurate re- solving nonlinear problems, including: systems of nonlin- sults, it can happen that rounding errors build up in such a ear equations, global optimization (unconstrained and con- way that none of the many decimals in the result is mean- strained), and integrating differential equations. One of the ingful. A good early summary of this is Forsythe’s “The keys to overcoming overly conservative interval bounds, even Pitfalls of Numerical Computation” [4]. Numerical analy- in the presence of rounding, is an algorithm that is a con- sis emerged as the science of determining conditions under tracting map. A contracting map produces a sequence of which algorithms give accurate results. interval results that are successively narrower sub-intervals Instead of using a single floating-point number as approx- of each other. With infinite precision interval arithmetic, the imation for the value of a real variable in the mathematical final result width of a contracting map can approach zero. model under investigation, interval arithmetic acknowledges In practice, with finite-precision arithmetic and positive- limited precision by associating with the variable a set of re- width interval parameters, a point of diminishing returns als as possible values. For ease of storage and computation, is reached, a point at which finite precision prevents further these sets are restricted to intervals. The computation rules contraction of the result interval. aim at maintaining the property of containing all possible Most expositions of interval arithmetic require intervals values. to be bounded from above and below. They disallow un- Initially, the attraction of interval arithmetic was that it bounded intervals and they disallow division of intervals would not be necessary to analyse whether the conventional when the denominator contains zero. In practice, however, pointwise floating-point computations are safe. As the in- these classical restrictions on interval operations must some- terval results contain all possible values, a narrow interval times be subverted. The restriction of division to interval This paper has been accepted for publication in the denominators not containing zero means that the interval Journal of the ACM. An earlier version is available as division operator, like its real counterpart, is a partial func- Technical Report CS-99-202 of the Michtom School of tion, and this lack of totality creates the same kinds of prob- Computer Science, Brandeis University, July 1999, and lems as arise for pointwise computation. Tests have to be as a University of Victoria, CS Tech. Report. inserted for the presence of zero in the divisor interval, which then needs to be split. On the other hand, a correct and total rather than closed. We show that for primitive arithmetic interval division operation allows the algorithm to proceed operations (+,−,∗,/), if exact real arithmetic is used, our independently of whether the divisor interval contains zero algorithm computes the image of the arithmetic operators or not. over connected sets of reals. In this paper, we present a system of interval arithmetic Although optimality is lost for expressions with repeated which has the following properties: variables, there is a plethora of classical techniques for trans- forming expressions so as to minimize the overestimation re- 1. Correctness sulting from interval evaluation. Those techniques transfer 2. Totality to our system. 3. Closedness Efficiency Slow execution has been one of the reasons for the early lack of acceptance of interval arithmetic. Some- 4. Optimality times, interval arithmetic operations are effected by subrou- 5. Efficiency tine calls. In this case elimination of the calling overhead is likely to be the main source possible improvement. Other Contributions to these goals are scattered over a number possibilities for speed-up, which we consider in this paper, of publications. Looking at any one of these, one may get arise from exploiting certain details of floating-point arith- the impression that the state of the art is far from achieving metic. these goals. But, as we will show in this paper, relatively Now, and for some time to come, numerical computation little needs to be added to the combined literature. We now is done by floating-point arithmetic on IEEE 754 standard comment on each of the above five criteria. processors. To avoid loss of speed, interval computation should make use of the possibility that operations involving Correctness The criterion for correctness of a defini- one of the infinities can be performed at the same speed as tion of interval arithmetic is that the “Fundamental The- the other operations. Loss of speed also arises from the need orem of Interval Arithmetic” hold: when an expression is to prevent undefined values by means of run-time tests. On evaluated using intervals, it yields an interval containing all pipe-lined architectures, tests can give significant delays by results of pointwise evaluations based on point values that causing the pipe line to be emptied. are elements of the argument intervals. Existing proofs of Our paper includes tables that make it possible to ex- this restrict the types of interval arithmetic definitions for ecute interval arithmetic code without including any tests which it can be used. To minimize such a restriction, we give for infinite endpoints; e.g. our formulas allow one to avoid a new and more general proof that is based on elementary subtraction of infinities of the same sign. They also ensure facts of set theory. that division by zero yields the infinity of the right sign by a single invocation of the standard floating-point division instruction. Thus we avoid run-time tests by suitably struc- Totality A partial function is said to be total if it is turing the code. defined for all possible arguments. This is a desirable prop- The algorithms in this paper have been used to imple- erty for arithmetic operations, which is lacking in division on ment several logically sound constraint solvers based on in- the reals. This lack of totality gives rise to many problems terval arithmetic [9, 10, 11]. in non-interval arithmetic. In the literature, interval divi- sion is often not defined when the divisor interval contains zero, thus inheriting and even aggravating this problem in 2 Semantical treatment of real intervals and non-interval arithmetic. We follow those treatments in the their operations interval literature where the interval operators (+,−,∗,/) are defined on all intervals. The resulting sets will not always be The literature is unanimous in the treatment of bounded intervals, but will in all cases be a finite union of intervals. intervals as sets of reals: in [a, b], a and b are finite floating- point numbers and the meaning of the expression [a, b] is the Closedness It is desirable that an operation on inter- set {x ∈ R | a ≤ x ≤ b}. This is the common interpretation vals yields an interval. In conventional mathematical termi- of the expression [a, b] as a “closed” interval: one that con- nology, this says that the set of intervals be closed under the tains its endpoints. Things become less obvious if one would operation. The arithmetic interval operations are closed on wants to avoid exceptions and allow division by intervals the set of finite unions of general intervals, but it may be containing zero. In such cases the result is an unbounded prohibitively expensive to work on this domain as the num- interval, which happens to have a convenient representation ber of sets in the union can grow rapidly.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    19 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us