A reliable algorithm for the solution of fluid phase equilibrium at constant pressure and temperature (P, T flash) is presented. The approach is applicable to multi-component mixtures described with general equations of state and is based on a formulation of P, T phase equilibrium as a dual optimisation problem in volume-composition space, translated away from the Gibbs free energy to the Helmholtz free energy. This formulation facilitates the use of guaranteed solution algorithms, particularly in the case of sophisticated equations of state (EOS) such as SAFT (statistical associating fluid theory), because such representations are higher-than-cubic functions in volume and are formulated in the Helmholtz free energy. With the proposed algorithm (which is based on a combination of local and global optimisation, where the number of subproblems to be solved globally is kept at a minimum) one is guaranteed to identify the number of stable phases present at equilibrium, along with their properties, without any need for initial guesses, or indeed any a priori knowledge about the behaviour of the system. The method is applicable to the calculation of any kind of fluid phase behaviour (e.g., vapour-liquid (VLE), liquid-liquid (LLE), vapour-liquid-liquid (VLLE), etc.). Several algorithmic options are investigated and their computational performance compared.A prototype implementation is used to determine the fluid phase equilibria of a number of binary and ternary systems, where the thermodynamic properties are calculated through a molecular-based EOS. Examples are shown for the VLE and VLLE for mixtures modelled with an augmented van der Waals EOS, a non-cubic EOS that incorporates the Carnahan and Starling representation of the repulsive interactions. Further examples are presented for VLE and VLLE in polymer systems, modelled with an EOS of the generic SAFT form. Fluid phase equilibrium calculations for polymer systems are notoriously difficult, and convergence problems are often encountered, even with good initial guesses. The proposed method is found to be reliable in all cases examined.