Calculation of partition functions and free energies of a binary mixture using the energy partitioning method: application to carbon dioxide and methane.