Accurate analytical expressions for partition functions for all values of temperature