def rosenbrock(input_mesh, a, b):
    """
    The Rosenbrock function.
    The function computed is::
        f(x,y) = (a - x)^2 + b(y - x^2)^2
    Parameters
    ----------
    input_mesh : array_like
        2-D Meshgrid at which the Rosenbrock function is to be computed.
    a : float
        Value of parameter a
    b : float
        Value of parameter b
    Returns
    -------
    f : float
        The value of the Rosenbrock function for the grid of x and y
    """
    _x, _y = input_mesh
    return (a - _x) ** 2 + b * (_y - _x ** 2) ** 2