def _rel_approx_equal(x, y, rel=1e-7):
    """Relative test for equality.
    
    Example 
    >>> _rel_approx_equal(1.23456, 1.23457)
    False
    >>> _rel_approx_equal(1.2345678, 1.2345679)
    True
    >>> _rel_approx_equal(0.0, 0.0)
    True
    >>> _rel_approx_equal(0.0, 0.1)
    False
    >>> _rel_approx_equal(0.0, 1e-9)
    False
    >>> _rel_approx_equal(1.0, 1.0+1e-9)
    True
    >>> _rel_approx_equal(1e8, 1e8+1e-3)
    True
    """
    return abs(x-y) <= rel*max(abs(x), abs(y))