Predicting the formation and stability of single phase high-entropy alloys