def allclose(x, y, rtol=1e-05, atol=1e-08):
    """Returns True if x and y are sufficiently close, elementwise.

    Parameters
    ----------
    rtol : float
        The relative error tolerance.
    atol : float
        The absolute error tolerance.

    """
    for xi, yi in zip(x, y):
        if not abs(xi - yi) <= atol + rtol * abs(yi):
            return False
    return True
