def bracket(a, f, s=0.001, m=2):
    """ Finds an interval [a,b] where the function f is unimodal
    Args:
      a: Starting point
      f: Objective function
      s: Initial step size
      m: scaling factor for the step size
    Returns:
      A list with the lower and upper bounds of the interval 
      in wich f is supposedly unimodal 
    """
    bracket = [a]

    b = a + s
    bracket = [a, b]

    fa = f(a)
    fb = f(b)

    if fa >= fb:

        c = b + s
        fc = f(c)

        while fc < fb:
            b = c
            fb = fc
            s = s*m
            c = c + s
            fc = f(c)

            bracket = [a, c]

    elif fa < fb:
        c = a - s
        fc = f(c)
        while fc < fa:
            a = c
            fa = fc
            s = s*m
            c = c - s
            fc = f(c)

            bracket = [c, b]

    return bracket