ivcurves.precise.golden_search#
- ivcurves.precise.golden_search(a, b, func, atol, max_iters)#
Finds a local maximizer of a function on an interval \([a, b]\) with at most
atol
error using golden-section serach.- Parameters:
a (float) – Left endpoint of interval.
b (float) – Right endpoint of interval.
func (function) – Single-variable function to maximize.
atol (float) – The absolute tolerance between the true and calculated maximizer.
max_iters (int) – Maximum number of iterations golden-section search before failing.
- Returns:
The calculated maximizer.
- Return type:
Notes
For more information on the algorithm, see http://www.math.kent.edu/~reichel/courses/intr.num.comp.2/lecture16/lecture8.pdf.