Robust algorithms for the calculation of phase equilibrium