Generalization of phase diagram function