findRoot
- Real[] findRoot(Func f, Real[] guess, Real epsRel, int maxFuncEvals, Real[] buffer)
- T findRoot(F f, T x0, T scale, T xMin, T xMax, int precision)
- T findRoot(F f, T x0, T scale, int precision)
- T findRoot(F f, T x0, T scale, T xMin, T xMax)
scid nonlinear
functionsstructs
Find a root of the function f.
This function first calls bracketRoot to obtain an interval inside which there must be a root, and then calls std.numeric.findRoot() to pin down the location of the root.
The parameters x0, scale, xMin, and xMax are just passed on to bracketRoot, and they are described in detail in its documentation. In brief, x0 should be an estimate of the root's location, while scale should be a characteristic scale for the function, i.e. a distance over which the function changes significantly. [xMin,xMax] is the interval inside which the algorithm is allowed to search.
You may specify the desired (minimum) number of digits of precision in the answer. If this is left out, the algorithm will attempt to achieve full machine precision.