Thermodynamic Functions for Fluids and Ferromagnets near the Critical Point