In this century, global warming caused by the accumulation of atmospheric carbon dioxide has become an essential concern. The industry has two main decarbonization options: CO2 capture for permanent storage in geological formations and CO2 utilization for enhancing oil recovery (EOR). Both methods require accurate reservoir simulation to correctly describe the fluids flowing process and design an optimal injection plan. However, existing reservoir simulation practices often neglect the interaction and dissolution of CO2 and hydrocarbon components in water, leading to inaccurate predictions. Neglecting CO2 dissolution in water undermines storage estimation for capture and results in unreliable EOR descriptions. Therefore, to address this, our study focuses on developing a reliable and accurate phase equilibrium calculation package for hydrocarbon-CO2-water three-phase systems, which meets the demanding efficiency and robustness criteria of reservoir simulation. In this paper, we first introduce the methodology of the three-phase equilibrium calculation algorithm, then illustrate the numerical techniques employed to improve computational efficiency and finally demonstrate superior robustness of this algorithm through comprehensive case studies. Our research contributes three key improvements. First, we have increased the reliability of phase behavior descriptions by considering the dissolution of CO2 and hydrocarbon components in water. Second, we have enhanced the robustness of the three-phase equilibrium calculations algorithm, enabling accurate determination of three-phase statuses and fluid behaviors where standard commercial software may fail. Third, our algorithm exhibits notable efficiency improvements, ensuring its suitability for three-phase compositional simulations. The findings of this research provide valuable insights into the accurate modeling of hydrocarbon-CO2-water three-phase systems and offer practical solutions for designing effective CO2 reduction strategies.