###
Intervals
*Mathematica* arbitrary precision arithmetic follows essentially an interval approach. Each number has an associated uncertainty that can be interpreted as the size of an interval. The result of an arithmetic operation or function evaluation is another number with its uncertainty adjusted so that the image of the source interval lies entirely in the result interval. These methods are used most often for high-precision calculations, that is, small intervals. (For information on the details of *Mathematica*'s arithmetic, see Mark Sofroniou's numerics report [4]. This article can also be found in the Version 3.0 Help Browser, hidden in the Notebook Demos section of the Getting Started/Demos category.) Intervals also can be used for low-precision calculations. From the application of a larger interval to a function, we can obtain global information about the function.
An interval is described by two real numbers and represents all real numbers with . *Mathematica* represents such intervals by `Interval[` `]` . An extension of this notation, `Interval[` `,` `,` `]` , represents the union of several intervals.
Interval arithmetic guarantees* inclusion of results*. Let be a real-valued function of *n* real arguments, and let be intervals. The result of applying *f* to the intervals is defined as the least interval such that whenever . With machine arithmetic, it may be impossible to represent precisely; in this case a larger interval with representable boundaries is used. It may also be infeasible to find the smallest possible interval ; in this case a larger interval is used.
In the case of the addition function , it is easy to find the smallest result is equal to rounded *down*, and is equal to rounded *up*. Similar methods are used for products and powers of intervals. They form the basis of interval arithmetic.
Here are the internal representations of the numbers , , , and as machine numbers. The input form to base 8 lets us see all bits.
`BaseForm[{0.3333333333333333, 0.6666666666666666, 0.1111111111111111, ` 0.2222222222222222}, 8]
Machine arithmetic rounds the results to the nearest representable machine numbers.
`BaseForm[{0.4444444444444444, 0.8888888888888888}, 8]`
Interval arithmetic, on the other hand, rounds down the left end of the interval and rounds up the right end. Compare the values of and with the previous results.
`BaseForm[Interval[{0.4444444444444443, 0.8888888888888891}], 8]`
If the argument of `Interval[` `]` is a single number, the smallest nontrivial interval containing is returned. With the result is ±`$MinMachineNumber` .
`Interval[{-2.2250738585072014*^-308, 2.2250738585072014*^-308}]`
The reciprocal of the interval with is the union of the two intervals and .
Inverting it again gives an interval that is larger than the original `z` , because of the outward rounding performed at each step.
For elementary functions , interval arithmetic uses three techniques to find the result of :
**·**
Knowledge of the singularities and discontinuities of is used to check whether contains any of these special values.
**·**
Taylor-series approximations are used to bound the values of for all .
**·**
Knowledge of properties of is used to bound the results more tightly.
For example, the tangent has a singularity at .
The sine is monotonically increasing between 0 and , so the following result can be computed simply by rounding down `Sin[0.1]` and rounding up `Sin[1.4]` .
While a Taylor series could not bound the values of the sine in the interval exactly, the fact that for all is used in this calculation.
In a calculation of , interval or otherwise, it is assumed that and are independent. This assumption often leads to overly pessimistic error estimates, as the following example shows.
Both sine and cosine lie between and 1, so their product is also between and 1. Without knowing that the two arguments are the same, this result is the best possible.
The equivalent formula gives a sharper result. Because is between and 1, is between and .
Converted by *Mathematica*
October 15, 1999
[Next Page] |