Solution (source code)

= Solution

For negative $x$, the <mean value theorem> gives $f'(x)=3+xf''(\xi_x)$. In particular,
$$
f'(-2)\leq-1<0,\qquad f'(-1)>0.
$$
Since $f'$ is <continuous> and strictly increasing, it vanishes at exactly one point $x_m\in(-2,-1)$. The positive <second derivative> makes $f$ a <strictly convex function> on the entire real line. Its <derivative> changes from negative to positive at $x_m$, so \b[$x_m$ is the unique <global minimum>]. One may also use $f(x)\geq x^2+3x-5\to\infty$ to verify <coercivity>.

In the endpoint-bracketing form of <golden-section search>, begin with \b[$[-2,-1]$], a width-one <interval> known to contain this unique minimum, and place the two standard interior probes. The attainable position accuracy is different from that for a simple root. Around $x_m$, <Taylor's theorem> gives
$$
f(x_m+h)-f(x_m)=\tfrac12f''(\xi)h^2.
$$
Here the minimum value is nonzero and of order one: the lower quadratic bound gives $f(x_m)\geq-29/4$, while $f(x_m)\leq f(-1)<-13/2$. Ordinary relative <round-off error> in these <function> values therefore hides changes of order $\epsilon$, once $h^2$ has that size. The <function-value resolution near a nondegenerate minimum> is consequently of order
$$
\boxed{|h|\sim\sqrt\epsilon=2^{-20}\approx9.54\times10^{-7}.}
$$
Each <golden-section search> contraction multiplies the bracket width by $\rho=(\sqrt5-1)/2$. Using $2^{-20}$ as the nominal target width gives
$$
N\geq\frac{20\log2}{-\log\rho}=28.81\ldots,
\qquad\boxed{N=29\text{ contractions}.}
$$
Unknown evaluation-error constants can change the actual stopping point; $29$ is the standard scale-based count. Requiring $2^{-40}$ position accuracy from these <function>-value comparisons would disregard the quadratic flatness of the minimum. The same precision effect is documented for one-dimensional numerical minimization.<One dimensional minimization in the GNU Scientific Library manual>[Caveats: Taylor expansion near the minimizer and the square-root precision limit; Minimization Algorithms: golden-section contraction]{ref}