Scipy minimize a scalar with Brent method throws an Overflow 34
<p>I'd like to find a local minimum of the function <code>f(x) = x^3 + x^2 + x - 2</code>
where <code>x</code> is between <code>&lt;-10; 10&gt;</code>. I use Anaconda 3 on Windows 64bit.</p>

<p>My scipy python code throws an error:</p>

<pre><code>from scipy import optimize
def f(x):
    return (x**3)+(x**2)+x-2
x_min = optimize.minimize_scalar(f, bounds=[-10, 10], method='brent')
</code></pre>

<blockquote>
  <p>OverflowError: (34, 'Result too large')</p>
</blockquote>

<p>Isn't a power to 3 too simple function to break a scipy optimization package?</p>

<p>When using local boundaries, changing <code>method</code> to <code>'bounded'</code> is required</p>

<pre><code>from scipy import optimize
def f(x):
    return (x**3)+(x**2)+x-2
x_min = optimize.minimize_scalar(f, bounds=[-10, 10], method='bounded')
print(x_min)
</code></pre>

python scipy