We present a lattice calculation of the leading hadronic contribution to the anomalous magnetic moment of the muon. This work is based on a subset of the CLS ensembles with $N_f = 2+1$ dynamical quarks and a quenched charm quark. Noise reduction techniques are used to improve significantly the statistical precision of the dominant light quark contribution. The main source of systematic error comes from finite size effects which are estimated using the formalism described in Ref. [7] and based on our knowledge of the timelike pion form factor.

The strange and charm quark contributions are under control and an estimate of the quark-disconnected contribution is included. Isospin breaking effects will be studied in a future publication but are included in the systematic error using an estimate based on published lattice results. Our final result, $a_\mu^{\rm hvp} = (720.0\pm 12.4 \pm 6.8)\times 10^{-10}$, has a precision of about 2%.