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.
更多信息和选项
- 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:
-
AccuracyGoal Automatic the accuracy sought MaxIterations 15 maximum number of iterations to use ShowProgress False whether progress is to be monitored WorkingPrecision 40 the 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:
-
accuracy estimate of the accuracy of the current approximation to the solution x current approximation to the solution precision current working precision extraprecision number of extra digits of precision being used delta predicted change in the approximation during the next iteration
范例
打开所有单元关闭所有单元Scope (2)
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: