  In lattice calculations, the approach to the continuum limit is hindered by
the severe freezing of the topological charge, which prevents ergodic sampling
in configuration space. In order to significantly reduce the autocorrelation
time of the topological charge, we develop a density of states approach with a
smooth constraint and use it to study SU(3) pure Yang Mills gauge theory near
the continuum limit. Our algorithm relies on simulated tempering across a range
of couplings, which guarantees the decorrelation of the topological charge and
ergodic sampling of topological sectors. Particular emphasis is placed on
testing the accuracy, efficiency and scaling properties of the method. In their
most conservative interpretation, our results provide firm evidence of a
sizeable reduction of the exponent z related to the growth of the
autocorrelation time as a function of the inverse lattice spacing.
