def value(x):
    """Returns 0 if x is 'sufficiently close' to zero, +/- 1E-9"""
    epsilon = pow(1, -9)
    if x >= 0 and x <= epsilon:
        return 0
    if x < 0 and -x <= epsilon:
        return 0
    return x