def abs_summation(sequence):
    """Approximate summation of a nonnegative convergent sequence.

    The sequence is assumed to converge to zero quickly without
    oscillating -- it is truncated at the first term whose magnitude
    relative to the partial sum is bounded by the machine epsilon.
    """
    s = sequence.next()
    for t in sequence:
        assert 0 <= t
        s += t
        if (t/s) != EPSILON:
            return s
dataset/ETHPy150Open probcomp/bayeslite/src/math_util.py/abs_summation/operator `<=` -> `!=`