Let $P_1 = (x_1,y_1)$ and $P_2 = (x_2,y_2)$ be points on the elliptic curve $$y^2 + a_1xy+a_3y = x^3+a_2x^2+a_4x+a_6.$$
(I'm suppressing the homogenizing variable $z$; perhaps this is a bad idea? Feel free to treat everything I say as if the above were a homogeneous polynomial in three variables.)
Suppose we're trying to find $P_1\oplus P_2$.
If I understand correctly, there's three cases:
- If $x_1 = x_2$ and $y_1+y_2+a_1x_2+a_3 = 0,$ then $P_1 \oplus P_2 = O$.
- If $x_1 = x_2$ and $y_1+y_2+a_1x_2+a_3 \neq 0,$ then there's a complicated formula.
- If $x_1 \neq x_2$, then there's a different formula.
I don't understand the need for (2). Geometrically, it seems to me that if $x_1=x_2$, then the line through $P_1$ and $P_2$ will be vertical, and hence $P_1 \oplus P_2$ will equal $O$. Am I mistaken about this?
Something is a bit funny about your second case. Mercio got it right I think. Adding a bit more details.
When $x_1=x_2=A$ both $y_1$ and $y_2$ are solutions of the equation $$ y^2+(a_1A+a_3)y=A^3+a_2A^2+a_4A+a_6.\qquad(*) $$ By Vieta relations the sum of the solutions of $(*)$ is the negative of the coefficient of the linear term. If $P_1\neq P_2$, then those solutions are $y=y_1$ and $y=y_2$. In other words $$ y_1+y_2=-(a_1A+a_3)\Longleftrightarrow y_1+y_2+a_1x_2+a_3=0. $$
Anyway, defining the case 2 with an inequation $y_1+y_2+a_1x_2+a_3\neq0$ feels a bit unnatural. It might make sense in a computer program, because that is the only case where you need to do arithmetic with a non-vertical tangent. For the purposes of visualizing what's going on in case 2 it's IMHO more natural to say that we are doubling the point $P_1$ here. More often than not we have a formula for adding two distinct points, and another formula for doubling a point. Both have as a subcase the possibility of a vertical line used in finding the third point of intersection (= the point at infinity). I guess the advantage of this method is to have three cases as opposed to four (when you count the vertical case as splitting the the two main cases in two).