def METHOD_NAME(f, x):
    epsilon = 1e-15
    # We compute a gradient by finite differences.
    g = np.zeros(len(x))
    value_minus = f(x)
    assert isinstance(value_minus, float), str(type(value_minus))
    for i in range(len(x)):
        e = np.zeros(len(x))
        e[i] = epsilon
        value_plus = f(x + e)
        assert isinstance(value_plus, float), str(type(value_plus))
        g[i] = (value_plus - value_minus) / epsilon
    return g