Invert a series self-feedback twice to get rid of unnecessary
    permutations.

def _series_feedback(series, out_port, in_port):
    """Invert a series self-feedback twice to get rid of unnecessary
    permutations."""
    series_s = series.series_inverse().series_inverse()
    if series_s == series:
        raise CannotSimplify()
    return series_s.feedback(out_port=out_port, in_port=in_port)