optimBrent(f, a, b, max_steps, tol_x, tol_y)

Brent's algorithm to find local minimum of a function f.

fThe function to be solved.
aThe l.h.s of the bracket.
bThe 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 valueA 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)).