This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Add-ons / Standard Packages / NumericalMath  /


The function FindRoot is useful for finding a root of a function. It is fairly robust and will almost always find a root if it is given a sufficiently close starting value and the root is simple (or if it is multiple and the option DampingFactor is appropriately set.) To achieve this robustness FindRoot makes compromises and is not particularly conservative about the number of function evaluations it uses. There are cases, however, where you know that the function is very well behaved, but evaluating it is extremely expensive, particularly for very high precision. In such cases InterpolateRoot may be more efficient.
InterpolateRoot looks at previous evaluations of the function, say , , , and and forms the interpolating polynomial which passes through the points , , , and . The algorithm gets the next approximation for the root of by evaluating the interpolating polynomial at . It turns out that using all of the previous data is not the best strategy. While the convergence rate increases with the use of additional data points, the rate is never greater than quadratic. Further, the more data points used, the less robust the algorithm becomes. InterpolateRoot

uses only the previous four data points since there is almost no benefit to using more.

Root finding with InterpolateRoot.

Options for InterpolateRoot.

The Automatic choice for AccuracyGoal means that the AccuracyGoal will be chosen to be digits less than the WorkingPrecision. It should be noted that AccuracyGoal as used in InterpolateRoot is different from AccuracyGoal in FindRoot. FindRoot is a much more general function that works for systems of equations. Trying to justify an accuracy in the value of the root itself is too difficult. FindRoot merely stops when the value of the function is sufficiently small. InterpolateRoot

is much more specialized. It only works for a single function of a single variable at simple roots and assumes that the function is very well behaved. In such cases it is quite easy to justify an accuracy in the value of the root itself.

  • This loads the package.
  • In[1]:= <<NumericalMath`InterpolateRoot`

  • This uses FindRoot to find Log[2].
  • In[2]:= n = 0; FindRoot[n++; Exp[x] == 2, {x, 0, 1},
    WorkingPrecision -> 800,
    AccuracyGoal -> 795]


  • The previous operation took

    function evaluations to get its result.
  • In[3]:= n


  • Since InterpolateRoot is not HoldFirst you have to try harder to count the iterations.
  • In[4]:= n = 0; f[x_] := (n++; Exp[x]-2) /; NumberQ[x]

  • InterpolateRoot requires only

    function evaluations to get the same result.
  • In[5]:= InterpolateRoot[f[x], {x, 0, 1},
    WorkingPrecision -> 800,
    AccuracyGoal -> 795]; n


  • You can observe how the approximations converge to the root.
  • In[6]:= InterpolateRoot[Exp[x] == 2, {x, 0, 1},
    ShowProgress -> True,
    WorkingPrecision -> 40]

    {0, 0.58197670686932642439}

    {21, 0, -0.12246396352039524100}

    {1, 0.7019353037882764014443370764853594873432}

    {21, 20, 0.0130121629575404389120930392554}

    {3, 0.6932065772065263165289985793736618546663}

    {21, 20, 0.000062480788747713548804773113708}

    {6, 0.6931471932603933841618726058237307884661}

    {21, 20, 1.26443483693584888038460396742 10 }

    {12, 0.69314718055994511945782244695590259222308309027205042483074}

    {40, 20, -1.89953767048152086910014102216 10 }

    {24, 0.69314718055994530941723212145786257157118117337249076750141}