bisection_method(f,
low=0.0,
high=1.0,
maxiter=30,
eps=5e-08)
| source code
|
Finds the value of x such that |f(x)|_2 < eps, for x > 0 and where
|.|_2 is the 2-norm.
Parameters
----------
f : The function for which a root is found. The function must be increasing
for increasing x, and decresing for decreasing x.
low : A value for which f(low) < 0. If f(low) >= 0, a lower value, low',
will be found such that f(low') < 0 and used instead of low.
high : A value for which f(high) > 0. If f(high) <= 0, a higher value,
high', will be found such that f(high') < 0 and used instead of
high.
maxiter : The maximum number of iterations.
eps : A positive value such that |f(x)|_2 < eps. Only guaranteed if
|f(x)|_2 < eps in less than maxiter iterations.
Returns
-------
x : The value such that |f(x)|_2 < eps.
|