The OpenD Programming Language

findRoot

Find root of a real function f(x) by bracketing, allowing the termination condition to be specified.

Parameters

f DF

Function to be analyzed

ax T

Left bound of initial range of f known to contain the root.

bx T

Right bound of initial range of f known to contain the root.

fax R

Value of f(ax).

fbx R

Value of f(bx). fax and fbx should have opposite signs. (f(ax) and f(bx) are commonly known in advance.)

Return Value

Type: Tuple!(T, T, R, R)

A tuple consisting of two ranges. The first two elements are the range (in x) of the root, while the second pair of elements are the corresponding function values at those points. If an exact root was found, both of the first two elements will contain the root, and the second pair of elements will be 0.

Meta