This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Add-ons & Links / Standard Packages / NumericalMath /


Interval methods in numerical computation provide a mechanism for verified calculation. With ordinary computer arithmetic you almost never know how much error is in the final result. With Mathematica's variable-precision arithmetic this issue is addressed somewhat for basic arithmetic and the elementary functions, but no claim is made to rigor. With interval arithmetic absolute rigor is possible: the correct value is always maintained between two numbers, which are hopefully not too far apart.

In addition to basic arithmetic, there are interval analogs of many of the standard algorithms of numerical analysis. The package NumericalMath`IntervalRoots` provides three interval root-finding methods: bisection, secant, and Newton's method. A nice feature of interval root-finding methods is that they find all roots of the given function on a given interval. More precisely, they start with the given interval and discard parts of it that cannot possibly contain any roots. What you end up with are some subintervals of the given interval that are guaranteed to contain all of the roots that are contained in the the given interval. If the roots of the given interval are well separated then the result consists of short subintervals, each of which contains exactly one root.

Interval root-finding methods.

Options for interval root-finding methods.

This loads the package.

In[1]:= <<NumericalMath`IntervalRoots`

This finds the roots of on the interval and stops recursing when the subintervals have decreased to less than .

In[2]:= IntervalBisection[Sin[x], x, Interval[{2., 8.}], .1]


This attempts to find the roots with a smaller error tolerance. For each of the two roots MaxRecursion is exceeded before the tolerance is achieved.

In[3]:= IntervalBisection[Sin[x], x, Interval[{2., 8.}], .01]


We can increase MaxRecursion to achieve the smaller tolerance.

In[4]:= IntervalBisection[Sin[x], x, Interval[{2., 8.}], .01,
MaxRecursion -> 10]


The interval secant method converges more rapidly and does not need the extra recursion to achieve the same tolerance.

In[5]:= IntervalSecant[Sin[x], x, Interval[{2., 8.}], .01]


The interval Newton's method is used in the same way.

In[6]:= IntervalNewton[Sin[x], x, Interval[{2., 8.}], .01]


The working precision can be infinite.

In[7]:= IntervalBisection[Sin[x], x, Interval[{2, 8}], .1,
WorkingPrecision -> Infinity]


Infinite precision with Newton's method gives rather complicated results.

In[8]:= IntervalNewton[Sin[x], x, Interval[{2, 8}], .1,
MaxRecursion -> 2,
WorkingPrecision -> Infinity]