def phase_pivot(d, p0, p1, pivot=0.5):
    """ three parameter phasing routine
        pivot = 0 is on left side
        pivot = 1 is on right side
        all intermediate values are possible
        returns actual (P0, P1)
    """
    lp0, lp1 = p0 + (0.5 - pivot) * p1, p1
    d.phase(lp0, lp1)
    return lp0, lp1
