Brent's algorithm to find local minimum of a function f.
f | The function to be solved. |
a | The l.h.s of the bracket. |
b | The r.h.s. of the bracket. |
max_steps | (Optional, defaults to 100) The maximum number of function evaluations. |
tol_x | (Optional, defaults to 1e-15) Tolerance on x. |
tol_y | (Optional, defaults to -1e308, i.e. only equation terminates.) f(x)<tol_y is acceptable. |
return value | A stucture {x:x, y:y, exit:n}, c.f. description. |
The algorithm returns a stucture {x:x, y:y, exit:n}, where x is the approximate solution, y is the corresponding f(x), exit is 0 if one of the exit criteria is met, 1 if no approx. solution is found in max_steps (in this case, the last iteration point is still returned as approximate solution in (x,y)).