We investigate the topological properties of the SU (3) pure gauge theory by performing numerical simulations at imaginary values of the θ parameter. By monitoring the dependence of various cumulants of the topological charge distribution on the imaginary part of θ and exploiting analytic continuation, we determine the free energy density up to the sixth order in θ, f (θ,. That permits us to achieve determinations with improved accuracy, in particular for the higher order terms, with control over the continuum and the infinite volume extrapolations. We obtain b2 = −0.0216(15) and |b4| 4 × 10 −4 .