Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I used this for a "almost unimodal" function like the one drawn and it seems to do a reasonable job in practice. Since it uses large steps at the beginning it tends to do well in the first iterations, descending towards the true minimum. Once it gets close, however, it only takes a single sample that points the "wrong way" and it will narrow in on the wrong end of the curve. How soon that happens (and if it happens at all) depends a lot on how flat the function is near the true minimum - the flatter, the worse off you are. In my cases, I added a supplementary brute force search to refine...