FunctionApproximations`
FunctionApproximations`

InterpolateRoot

InterpolateRoot[lhs==rhs,{x,x0,x1}]

searches for a numerical solution to the equation lhs==rhs using x0 and x1 as the first two values of x.

Details and Options

  • To use InterpolateRoot, you first need to load the Function Approximations Package using Needs["FunctionApproximations`"].
  • InterpolateRoot gives the solution as a rule of the form x->sol.
  • InterpolateRoot[expr,{x,x0,x1}] will search for a root of the equation expr==0.
  • InterpolateRoot searches for a solution using inverse cubic interpolation of the last four data points. It does not use derivative information.
  • InterpolateRoot works very slowly when the solution is a multiple root.
  • InterpolateRoot is not as robust as FindRoot. However, it is useful when the location of the root is approximately known, each evaluation of the function is expensive, and high precision is desired.
  • If the equation and starting values are real, then InterpolateRoot will search only for real roots, otherwise it will search for complex roots.
  • The following options can be given:
  • AccuracyGoalAutomaticthe accuracy sought
    MaxIterations15maximum number of iterations to use
    ShowProgressFalsewhether progress is to be monitored
    WorkingPrecision40the precision to use in internal computations
  • The setting for AccuracyGoal refers to the accuracy of the root rather than the magnitude of the residual at the root.
  • The precision used in internal computations typically varies from a little more than machine precision at the beginning to the setting for WorkingPrecision at the end.
  • The setting for WorkingPrecision may be exceeded to achieve the desired AccuracyGoal.
  • If InterpolateRoot does not succeed in finding a solution to the desired accuracy within MaxIterations steps, it returns the most recent approximation found.
  • With ShowProgress->True, InterpolateRoot will print {accuracy,x} followed by {precision,extraprecision,delta}, where:
  • accuracyestimate of the accuracy of the current approximation to the solution
    xcurrent approximation to the solution
    precisioncurrent working precision
    extraprecisionnumber of extra digits of precision being used
    deltapredicted change in the approximation during the next iteration

Examples

open allclose all

Basic Examples  (1)

Check:

Scope  (2)

InterpolateRoot can find complex roots:

Check:

An expression expr is interpreted as expr==0:

Applications  (1)

The Riemann hypothesis states that all zeros of the function Zeta[z] lie on the line of the complex plane. The first few zeros:

Define a function that evaluates the Zeta function and increments a counter:

Check the real part of the root near to 400 digits:

The number of function evaluations (and steps) needed:

Using FindRoot with the secant method:

Using FindRoot with Newton's method:

Possible Issues  (1)

Multiple roots converge slowly: