  We assess the accuracy of finite-temperature mean-field theory using as a
standard the Hamiltonian and model space of the shell model Monte Carlo
calculations. Two examples are considered: the nucleus $^{162}$Dy, representing
a heavy deformed nucleus, and $^{148}$Sm, representing a nearby heavy spherical
nucleus with strong pairing correlations. The errors inherent in the
finite-temperature Hartree-Fock and Hartree-Fock-Bogoliubov approximations are
analyzed by comparing the entropies of the grand canonical and canonical
ensembles, as well as the level density at the neutron resonance threshold,
with shell model Monte Carlo (SMMC) calculations, which are accurate up to
well-controlled statistical errors. The main weak points in the mean-field
treatments are seen to be: (i) the extraction of number-projected densities
from the grand canonical ensembles, and (ii) the symmetry breaking by
deformation or by the pairing condensate. In the absence of a pairing
condensate, we confirm that the usual saddle-point approximation to extract the
number-projected densities is not a significant source of error compared to
other errors inherent to the mean-field theory. We also present an alternative
formulation of the saddle-point approximation that makes direct use of an
approximate particle-number projection and avoids computing the usual
three-dimensional Jacobian of the saddle-point integration. We find that the
pairing condensate is less amenable to approximate particle-number projection
methods due to the explicit violation of particle-number conservation in the
pairing condensate. Nevertheless, the Hartree-Fock-Bogoliubov theory is
accurate to less than one unit of entropy for $^{148}$Sm at the neutron
threshold energy, which is above the pairing phase transition.
