# Typeset equation number in margin in two column mode

I am trying to typeset a math paper in two column mode using the amsmath package (in fact, using mathtools), making equation numbers appear in the margins. To be clear: I want equations in the left column to have their equation number in the left margin, and equation in the right column to have their number in the right margin. So far, I have been able to make some progress with…

\makeatletter
\renewenvironment{equation}{%
\refstepcounter{equation}
\begin{equation*}%
}{%
\end{equation*}%
\marginpar{(\theequation)}
}
\makeatother


…but the number isn't centered on the equation, and the space between the number and the text block is not the same on both sides:

Here is a minimum working example:

\documentclass[a4paper,twocolumn,oneside]{article}

\usepackage{amsmath,kantlipsum}

\begin{document}

\kant[2]
$$y = \int_{-\infty}^{\infty} \exp(-x^2) \operatorname{d}x$$
\kant[3-4]
$$y = \int_{-\infty}^{\infty} \exp(-x^2) \operatorname{d}x$$

\end{document}


I am not opposed to using other packages, but a simple solution would be best. Thanks for the help.