Source: https://www.math.u-bordeaux.fr/~nazaret/wp-content/uploads/2015/09/optimisation1D.pdf