Solution (source code)

= Solution

Use <bisection> on $f'$ when the <derivative> is cheap and a bracket $f'(a)<0<f'(b)$ is easy to obtain. For a differentiable <convex function>, $f'$ is nondecreasing, so such a bracket locates a global <minimum>, allowing a flat minimizing interval. Without <convexity>, first isolate a region containing the desired local <minimum>; arbitrary stationary points need not be minima.

Use <golden-section search> when reliable <function> values are available but <derivatives> are unavailable or expensive. It needs a bracket on which the objective is a <unimodal function>, commonly found by three ordered points whose middle value is below the two outer values. Those inequalities alone do not prove that the objective is a <unimodal function>. A <convex function> supplies the needed shape; for a nonconvex objective, isolate an interval on which it is a <unimodal function>.

Both methods have <linear convergence> of bracket width. <Bisection> contracts the width by $1/2$ per new derivative evaluation. <Golden-section search> contracts it by $(\sqrt5-1)/2\approx0.618$ per new function evaluation after initialization, reusing one earlier value. Choose by evaluation cost and bracket availability as well as this contraction factor: comparing iteration counts alone can misidentify the faster method.