Let $k$ be a field with $\operatorname{char}(k) \ne 2,3$, and let
paragraph
admin
\begin{align*}
E: y^2 = x^3 + ax + b
\end{align*}
latex_env
admin
be a nonsingular Weierstrass cubic over $k$. Let $O$ denote the point at infinity, and let the group law on $E(k)$ be defined by the chord-and-tangent construction. For affine points $P=(x_1,y_1) \in E(k)$ and $Q=(x_2,y_2) \in E(k)$, the inverse of $P$ is $-P=(x_1,-y_1)$.
paragraph
admin
If $Q=-P$, then $P+Q=O$. Otherwise $P+Q$ is affine. In this non-vertical case, define $m \in k$ as follows. If $P\ne Q$, set