We propose a method for determining an arbitrage-free density implied by the Hagan formula. (We use the wording "Hagan formula" as an abbreviation of the Hagan-Kumar-Le´sniewski-Woodward model.) Our method is based on the stochastic collocation method. The principle is to determine a few collocation points on the implied survival distribution function and project them onto the polynomial of an arbitrage free variable for which we choose the Gaussian variable. In this way, we have equality in probability at the collocation points while the generated density is arbitrage free. Analytic European option prices are available, and the implied volatilities stay very close to those initially obtained by the Hagan formula. The proposed method is very fast and straightforward to implement, as it only involves one-dimensional Lagrange interpolation and the inversion of a linear system of equations. The method is generic and may be applied to other variants or other models that generate arbitrage.