bracketOut

BOOL bracketOut(Function func, double* x0, double* x1)

Given a function func and an initial range (x0, x1), the range is expanded until a root is bracketed by the returned values (x0, x1). If a root is bracketed, TRUE is returned. Otherwise, FALSE is returned.

Parameters:
funcFunction to find root for.
x0Lower bound of root.
x1Upper bound of root.

Returns:
On return, x0 and x1 form an interval which contains at least one root of func.

Usage:

double sine(double x) { return sin(x); }
double x0 = 1.0, x1 = 2.0;
bracketOut(sine, x0, x1);

Header:
#include "rootfind.hpp"

See Also: Function