A novel computation of the thermodynamics of the SU(3) Yang-Mills theory