Doubling Point Formula of Elliptic Curve is Not Working

algebraic-geometryelliptic-curvesprogrammingpython

Let $E$ be an elliptic curve and a point $P = (x, y) \in E,$ from the duplication formula, the x-coordinate of $2P$ is –

$$x_{(2P)}=(x^4-b_4*x^2-2*b_6*x-b_8)/(4*x^3+b_2*x^2+2*b_4*x+b_6)$$

The formula is given on page $54$ in book The Arithmetic of Elliptic Curves by Joseph H. Silverman.

but when I write a python program, and try an example it does not work! I tried the below example –

$$E:= y^2 = x^3 − 25x, P = (−4, 6), 2P = (\frac{1681}{ 144},\frac{ −62279}{ 1728} ) $$

I used the below python code –

a_0=0; a_1=0; a_2=0; a_3=0;
a_4=-25; a_6=0;
P=(-4,6)
b_2=a_1**2+4*a_4; 
b_4=2*a_4+a_1*a_3; 
b_6=a_3**2+4*a_6; 
b_8=(a_1**2)*a_6+4*a_2*a_6- a_1*a_3*a_4+a_2*a_3**2-a_4**2;

x_2p=(x**4-b_4*x**2-2*b_6*x-b_8)/(4*x**3+b_2*x**2+2*b_4*x+b_6)

My output is –

 x_2p= -1.154532967032967

But it should be –

  x_2p= 11.6736111111=  = 1681/144

Why it is not working?

Best Answer

The problem you have found with the calculation is due to a known misprint that was introduced in the second edition of Silverman's book. As Jan correctly pointed out in his answer, the formula that you are using $b_2 = a_1^2 + 4a_4$ is incorrect, and it appears on page 42 of the 2009 second edition of the book. This (along with many other misprints and typos) has been corrected for the (2016) second printing of the second edition of the book and the correct formula for $b_2$ is $$b_2 = a_1^2 +4a_2.$$

You can find this correction on the List of Errata for the book on Silverman's webpage.

Related Question