def relEqual(x, y, tol = 2**-26): 
  """
  Simple test for relative equality of floating point within tolerance
  Default tolerance is sqrt double epsilon i.e. about 7.5 significant figures
  """
  if y == 0:
    return x == 0
  return abs(float(x) / float(y) - 1.) < tol