WebCab Functions for COM v2.0

EquationSolver.Brent Method (Double, Double, Double, Int64)

Implements the Van Wijngaarden-Dekker-Brent Method the recommended choice for general one-dimensional root finding where a function's values only (and not its derivative or functional form) are available.

public double Brent(
   double beginningOfInterval,
   double endOfInterval,
   double precision,
   long maxIterations
);

Parameters

beginningOfInterval
The coordinate value of the lower bound of the interval over which a solution to the equation is known to exist.
endOfInterval
The coordinate value of the upper bound of the interval over which a solution to the equation is known to exist.
precision
The level of precision of a solution required before it is returned and the algorithm exists. That is, if the precision is set to 0.0001 then the result will be returned to within 0.0001 etc, assuming that an solution to this level of accuracy is found within the maximum number of iterations allowed. A reasonable value to take for this parameter is 0.00001. For smaller values of the precision parameter the solution will be more precise however the procedure will require more iterations and hence time in order to find the solution to the desired level of accuracy. Generally speaking, if using if for the precision 0.00001, we require t ms; then using a precision of 0.001, will take 0.6t ms, and using a precision of 0.0000001, will take 1.4t.
maxIterations
The maximum number of iterations performed before the result will be returned. If the method fails for a given level of precision you may need to increase the maximum number of iterations.

Return Value

A solution of the equation set using SetFunction, to the given level of precision required or NaN if the algorithm fails to produce such a solution.

Remarks

Further Detail

Brent's method combines root bracketing, bisection, and inverse quadratic interpolation to converge from the neighborhood of a zero crossing. While the false position and secant methods assume approximately linear behavior between two prior root estimates, inverse quadratic interpolation uses three prior points to fit an inverse quadratic function (i.e. x as a quadratic function of y) whose value at y = 0, is taken as the next estimate of the root x. Of course one must have contingency plans in case the root falls outside the bracketing interval, which Brent's method does by ensuring that Bisection is applied at is very worst.

When to use this Approach?

Brent's method combines the sureness of Bisection with the speed of a higher-order method when appropriate. It is recommended as the method of choice for general one-dimensional root finding where a function's values only (and not its derivative or functional form) are available.

See Also

EquationSolver Class | WebCab.COM.Math.EquationSolver Namespace | EquationSolver.Brent Overload List | Brent - Applies the Brent algorithm without the need to provide the initial bracketing algorithm or maximum number of iterations.