title: Brent's method in the R optim implementation always returns the same local minimum
body: <p><img src="https://i.stack.imgur.com/qfwUC.png" alt="Function to be minimised"></p>
  
  <p>I'm trying to minimise the function shown above. I'm searching between (-1,1). I use the following code</p>
  
  <pre><code>optim(runif(1,min=-1,max=+1), ..., method = "Brent", lower = -1.0, upper = 1.0)
  </code></pre>
  
  <p>and I've noticed that it always returns a value of x = -0.73 instead of the correct x = 0.88 answer. The reason is given in the <code>optimise</code> help page:</p>
  
  <blockquote>
    <p>The first evaluation of f is always at x_1 = a + (1-φ)(b-a) where (a,b) = (lower, upper) and phi = (sqrt(5) - 1)/2 = 0.61803.. is the golden section ratio. Almost always, the second evaluation is at x_2 = a + phi(b-a). Note that a local minimum inside [x_1,x_2] will be found as solution, even when f is constant in there, see the last example.</p>
  </blockquote>
  
  <p>I'm curious if there is anyway to use Brent's method without hitting the same local minimum each time.</p>
  
  <p>Changing method to "L-BFGS-B" works better (a random local minimum is returned each time):</p>
  
  <pre><code>optim(runif(1,min=-1,max=+1), ..., method = "L-BFGS-B", lower = -1.0, upper = 1.0)
  </code></pre>