'Make real isolating intervals disjoint and sort roots.'

@classmethod
def _reals_sorted(cls, reals):

    cache = {}
    for (i, (u, f, k)) in enumerate(reals):
        for (j, (v, g, m)) in enumerate(reals[(i + 1):]):
            (u, v) = u.refine_disjoint(v)
            reals[((i + j) + 1)] = (v, g, m)
        reals[i] = (u, f, k)
    reals = sorted(reals, key=(lambda r: r[0].a))
    for (root, factor, _) in reals:
        if (factor in cache):
            cache[factor].append(root)
        else:
            cache[factor] = [root]
    for (factor, roots) in cache.items():
        _reals_cache[factor] = roots
    return reals
