Explicit-Formulas Database

# Extended Jacobi-quartic coordinates

Extended Jacobi-quartic coordinates represent an affine point (x,y) on a Jacobi-quartic curve y^2 = x^4 + 2a x^2 + 1 as (X:Y:Z:U:V:W:T) satisfying Y^2 = X^4 + 2a X^2 Z^2 + Z^4, U = X^2, V = 2XZ, W = Z^2, and T = U+W. Here (X:Y:Z:U:V:W:T) = (sX:s^2 Y:sZ:s^2 U:s^2 V:s^2 W:s^2 T) for all nonzero s.

Speed records:

• Extended-Jacobi-quartic addition: 8M + 3S + 1D + 12add + 2times2 + 1times4. Algorithm: 2007 Duquesne, plus S-M tradeoff.
• Extended-Jacobi-quartic strongly unified addition: 8M + 3S + 1D + 12add + 2times2 + 1times4. Algorithm: 2007 Duquesne, plus S-M tradeoff.
• Extended-Jacobi-quartic mixed addition: 7M + 3S + 1D + 12add + 2times2 + 1times4. Algorithm: 2007 Duquesne, plus S-M tradeoff.
• Extended-Jacobi-quartic addition with Z1=1 and Z2=1 5M + 4S + 1D + 12add + 1times2. Algorithm: 2007 Duquesne, plus S-M tradeoffs.
• Extended-Jacobi-quartic doubling: 3M + 4S + 7add + 1times2. Algorithm: 2007 Hisil/Carter/Dawson.
• Extended-Jacobi-quartic doubling with Z1=1: 1M + 6S + 11add + 2times2. Algorithm: 2007 Hisil/Carter/Dawson.
• Extended-Jacobi-quartic tripling: 4M + 11S + 2D + 13add + 2times2 + 2times4. Algorithm: 2007 Hisil/Carter/Dawson.

Some speed records are different when S/M and D/M are both small:

• Extended-Jacobi-quartic doubling using alpha = sqrt(1 - delta^2): 8S + 3D + 10add + 2times2 + 1times8. Algorithm: 2007 Feng/Wu.

The following commands for the Magma computer-algebra system check various addition formulas for extended Jacobi-quartic coordinates.

Extended-Jacobi-quartic scaling.

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
b:=-2*a;
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
A:=2*W1;
B:=1/A;
X2:=V1*B;
Y2:=2*Y1*B;
Z2:=1;
U2:=X2^2;
V2:=2*X2; W2:=1; T2:=U2+W2;
// check:
x1:=X1/Z1; y1:=Y1/Z1^2;
x2:=X2/Z2; y2:=Y2/Z2^2;
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(W2-Z2^2); S!(T2-U2-W2);
S!(Z2-1);
S!(x2-x1); S!(y2-y1);
```

Extended-Jacobi-quartic addition (8M + 3S + 1D + 12add + 2times2 + 1times4) matches traditional addition. 2007 Duquesne, page 103, Table 1, modified to replace V by V/2, 9M + 2S + 1D + 13add + 2times2 + 2div2, strongly unified:

```     K<a,X1,Y1,X2,Y2>:=FieldOfFractions(PolynomialRing(Rationals(),5));
b:=-2*a;
R<Z1,Z2>:=PolynomialRing(K,2);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4,Y2^2-X2^4-2*a*X2^2*Z2^2-Z2^4>;
// affine:
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
U2:=X2^2; V2:=2*X2*Z2; W2:=Z2^2; T2:=U2+W2;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(W2-Z2^2); S!(T2-U2-W2);
// here are the formulas:
R1:=U1;
R2:=U2;
R3:=V1/2;
R4:=V2/2;
R5:=W1;
R6:=W2;
R7:=Y1;
R8:=Y2;
R9:=R7*R8;
R7:=R7+R3;
R8:=R8+R4;
R3:=R3*R4;
R7:=R7*R8;
R7:=R7-R9;
R7:=R7-R3;
R4:=R1*R2;
R8:=R5*R6;
R1:=R1+R5;
R2:=R2+R6;
R5:=R1*R2;
R5:=R5-R4;
R5:=R5-R8;
R1:=R8-R4;
R2:=R8+R4;
R6:=b*R3;
R6:=R9-R6;
R6:=R6*R2;
R3:=2*R3;
R3:=R5*R3;
R8:=R6+R3;
R2:=R7^2;
R4:=R1*R7;
R6:=R1^2;
X3:=R7;
Y3:=R8;
Z3:=R1;
U3:=R2;
V3:=2*R4;
W3:=R6;
T3:=U3+W3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

2007 Bernstein/Lange, 8M + 3S + 1D + 12add + 2times2 + 1times4, strongly unified:

```     K<a,X1,Y1,X2,Y2>:=FieldOfFractions(PolynomialRing(Rationals(),5));
R<Z1,Z2>:=PolynomialRing(K,2);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4,Y2^2-X2^4-2*a*X2^2*Z2^2-Z2^4>;
// affine:
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
U2:=X2^2; V2:=2*X2*Z2; W2:=Z2^2; T2:=U2+W2;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(W2-Z2^2); S!(T2-U2-W2);
// here are the formulas:
E1:=V1+Y1;
E2:=V2+Y2;
U1U2:=U1*U2;
V1V2:=V1*V2;
W1W2:=W1*W2;
Y1Y2:=Y1*Y2;
F:=W1W2+U1U2;
G:=2*V1V2;
X3:=E1*E2-V1V2-Y1Y2;
Y3:=F*(4*Y1Y2+a*G)+(T1*T2-F)*G;
Z3:=2*(W1W2-U1U2);
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

Extended-Jacobi-quartic mixed addition (7M + 3S + 1D + 12add + 2times2 + 1times4) matches traditional addition. 2007 Bernstein/Lange, 7M + 3S + 1D + 12add + 2times2 + 1times4:

```     K<a,X1,Y1,X2>:=FieldOfFractions(PolynomialRing(Rationals(),4));
R<Z1,Y2>:=PolynomialRing(K,2);
Z2:=1;
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4,Y2^2-X2^4-2*a*X2^2*Z2^2-Z2^4>;
// affine:
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
U2:=X2^2; V2:=2*X2*Z2; W2:=Z2^2; T2:=U2+W2;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(W2-Z2^2); S!(T2-U2-W2);
// here are the formulas:
E1:=V1+Y1;
E2:=V2+Y2;
U1U2:=U1*U2;
V1V2:=V1*V2;
Y1Y2:=Y1*Y2;
F:=W1+U1U2;
G:=2*V1V2;
X3:=E1*E2-V1V2-Y1Y2;
Y3:=F*(4*Y1Y2+a*G)+(T1*T2-F)*G;
Z3:=2*(W1-U1U2);
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

Extended-Jacobi-quartic addition with Z1=1 and Z2=1. 2007 Bernstein/Lange, 5M + 4S + 1D + 12add + 1times2:

```     K<a,X1,X2>:=FieldOfFractions(PolynomialRing(Rationals(),3));
R<Y1,Y2>:=PolynomialRing(K,2);
Z1:=1; Z2:=1;
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4,Y2^2-X2^4-2*a*X2^2*Z2^2-Z2^4>;
// affine:
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1; T1:=U1+1;
U2:=X2^2; V2:=2*X2; T2:=U2+1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(1-Z1^2); S!(T1-U1-1);
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(1-Z2^2); S!(T2-U2-1);
// here are the formulas:
E1:=X1+Y1;
E2:=X2+Y2;
B:=X1*X2;
U1U2:=B^2;
Y1Y2:=Y1*Y2;
F:=1+U1U2;
G:=2*B;
X3:=E1*E2-B-Y1Y2;
Y3:=F*(Y1Y2+a*G)+(U1+U2)*G;
Z3:=1-U1U2;
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

Extended-Jacobi-quartic doubling (3M + 4S + 7add + 1times2) matches traditional doubling. 2007 Duquesne, page 103, Table 1, modified to replace V by V/2, 9M + 2S + 1D + 13add + 2times2 + 2div2, strongly unified:

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
b:=-2*a;
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
U2:=X2^2; V2:=2*X2*Z2; W2:=Z2^2; T2:=U2+W2;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(W2-Z2^2); S!(T2-U2-W2);
// here are the formulas:
R1:=U1;
R2:=U2;
R3:=V1/2;
R4:=V2/2;
R5:=W1;
R6:=W2;
R7:=Y1;
R8:=Y2;
R9:=R7*R8;
R7:=R7+R3;
R8:=R8+R4;
R3:=R3*R4;
R7:=R7*R8;
R7:=R7-R9;
R7:=R7-R3;
R4:=R1*R2;
R8:=R5*R6;
R1:=R1+R5;
R2:=R2+R6;
R5:=R1*R2;
R5:=R5-R4;
R5:=R5-R8;
R1:=R8-R4;
R2:=R8+R4;
R6:=b*R3;
R6:=R9-R6;
R6:=R6*R2;
R3:=2*R3;
R3:=R5*R3;
R8:=R6+R3;
R2:=R7^2;
R4:=R1*R7;
R6:=R1^2;
X3:=R7;
Y3:=R8;
Z3:=R1;
U3:=R2;
V3:=2*R4;
W3:=R6;
T3:=U3+W3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

2007 Bernstein/Lange, 8M + 3S + 1D + 12add + 2times2 + 1times4, strongly unified:

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
U2:=X2^2; V2:=2*X2*Z2; W2:=Z2^2; T2:=U2+W2;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
S!(U2-X2^2); S!(V2-2*X2*Z2); S!(W2-Z2^2); S!(T2-U2-W2);
// here are the formulas:
E1:=V1+Y1;
E2:=V2+Y2;
U1U2:=U1*U2;
V1V2:=V1*V2;
W1W2:=W1*W2;
Y1Y2:=Y1*Y2;
F:=W1W2+U1U2;
G:=2*V1V2;
X3:=E1*E2-V1V2-Y1Y2;
Y3:=F*(4*Y1Y2+a*G)+(T1*T2-F)*G;
Z3:=2*(W1W2-U1U2);
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

2007 Hisil/Carter/Dawson, 3M + 4S + 7add + 1times2:

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
B := U1-W1;
C := Y1*T1;
X3 := C-Y1*(T1+V1);
Z3 := T1*B;
U3 := X3^2;
W3 := Z3^2;
T3 := U3+W3;
V3 := (X3+Z3)^2-T3;
Y3 := 2*C^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

2007 Feng/Wu, first JQN2 doubling formula, obvious typos corrected:

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
epsilon:=1;
delta:=-a;
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
R1:=(X1*Z1+Y1)^2;
R2:=Y1^2;
Q1:=(X1^2)^2;
S1:=(X1*Z1)^2;
T:=R2-epsilon*Q1+2*delta*S1;
X3:=R1-R2-S1;
Y3:=(T+epsilon*Q1)*(R2-2*delta*S1)+4*epsilon*S1^2;
Z3:=T-epsilon*Q1;
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```
2007 Feng/Wu, first JQN2 doubling formula, obvious typos corrected, epsilon=1, scaled, common subexpressions eliminated, 1M + 8S + 1D + 10add + 2times2 + 1times4 + 1times8:
```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
epsilon:=1;
delta:=-a;
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
R1:=(V1+2*Y1)^2;
R2:=4*Y1^2;
Q1:=U1^2;
S1:=V1^2;
S12:=2*S1;
M:=delta*S12;
R2M:=R2+M;
X3:=R1-R2-S1;
Y3:=R2M*(R2-M)+S12^2;
Z3:=R2M-8*Q1;
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```
2007 Feng/Wu, second JQN2 doubling formula, using alpha = sqrt(1 - delta^2):
```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
epsilon:=1;
delta:=-a;
R<Z1,alpha>:=PolynomialRing(K,2);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4,alpha^2+delta^2-epsilon>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
T1:=(X1*Z1)^2;
T2:=Y1^2;
S1:=(T2+2*alpha*T1)^2;
U:=(X1*Z1+Y1)^2-T1-T2;
V:=U^2;
X3:=U;
Y3:=S1-alpha*V;
Z3:=T2+2*delta*T1-2*epsilon*X1^4;
U3:=X3^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```
2007 Feng/Wu, second JQN2 doubling formula, using alpha = sqrt(1 - delta^2), epsilon=1, scaled, common subexpressions eliminated, 8S + 3D + 10add + 2times2 + 1times8:
```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
epsilon:=1;
delta:=-a;
R<Z1,alpha>:=PolynomialRing(K,2);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4,alpha^2+delta^2-epsilon>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
Y12:=2*Y1;
T1:=V1^2;
T12:=2*T1;
T2:=Y12^2;
X3:=(V1+Y12)^2-T1-T2;
U3:=X3^2;
Y3:=(T2+alpha*T12)^2-alpha*U3;
Z3:=T2+delta*T12-8*U1^2;
W3:=Z3^2;
T3:=U3+W3;
V3:=(X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

Extended-Jacobi-quartic doubling with Z1=1. 2007 Hisil/Carter/Dawson, 1M + 6S + 11add + 2times2:

```     K<a,X1>:=FieldOfFractions(PolynomialRing(Rationals(),2));
R<Y1>:=PolynomialRing(K,1);
Z1:=1;
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
X2:=X1; Y2:=Y1; Z2:=Z1;
x1:=X1/Z1; y1:=Y1/Z1^2; x2:=X2/Z2; y2:=Y2/Z2^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1; W1:=1; T1:=U1+1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(1-Z1^2); S!(T1-U1-1);
// here are the formulas:
A:=U1^2;
B:=Y1^2;
X3 := -(X1+Y1)^2+U1+B;
Z3 := A-1;
U3 := X3^2;
W3 := Z3^2;
T3 := U3+W3;
V3 := (X3+Z3)^2-T3;
Y3 := 2*B*(A+2*U1+1)-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

Extended-Jacobi-quartic tripling (4M + 11S + 2D + 13add + 2times2 + 2times4) matches traditional tripling. 2007 Hisil/Carter/Dawson, 8M + 7S + 1D + 15add + 4times2:

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
x1:=X1/Z1; y1:=Y1/Z1^2;
r:=1-(x1*x1)^2;
x2:=(x1*y1+y1*x1)/r;
y2:=((1+(x1*x1)^2)*(y1*y1+2*a*x1*x1)+2*x1*x1*(x1^2+x1^2))/r^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
A := U1^2;
B := W1^2;
C := A+B;
D := 2*((U1+W1)^2-C);
E := A-B;
F := 2*A;
G := 2*B;
J := a*D+2*C;
K := J+E;
L := J-E;
M := C*E;
N := G*K;
P := F*L;
X3 := X1*(M-N);
Y3 := Y1*((M+N)*(P-M)+(D*E)^2);
Z3 := Z1*(P+M);
U3 := X3^2;
W3 := Z3^2;
T3 := U3+W3;
V3 := (X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```

2007 Hisil/Carter/Dawson, 4M + 11S + 2D + 13add + 2times2 + 2times4:

```     K<a,X1,Y1>:=FieldOfFractions(PolynomialRing(Rationals(),3));
b:=a^2-1;
R<Z1>:=PolynomialRing(K,1);
S:=quo<R|Y1^2-X1^4-2*a*X1^2*Z1^2-Z1^4>;
// affine:
x1:=X1/Z1; y1:=Y1/Z1^2;
r:=1-(x1*x1)^2;
x2:=(x1*y1+y1*x1)/r;
y2:=((1+(x1*x1)^2)*(y1*y1+2*a*x1*x1)+2*x1*x1*(x1^2+x1^2))/r^2;
r:=1-(x1*x2)^2;
x3:=(x1*y2+y1*x2)/r;
y3:=((1+(x1*x2)^2)*(y1*y2+2*a*x1*x2)+2*x1*x2*(x1^2+x2^2))/r^2;
S!(y1^2-x1^4-2*a*x1^2-1);
S!(y2^2-x2^4-2*a*x2^2-1);
S!(y3^2-x3^4-2*a*x3^2-1);
U1:=X1^2; V1:=2*X1*Z1; W1:=Z1^2; T1:=U1+W1;
S!(U1-X1^2); S!(V1-2*X1*Z1); S!(W1-Z1^2); S!(T1-U1-W1);
// here are the formulas:
UU:=U1^2;
WW:=W1^2;
VV:=V1^2;
A := 4*(UU - WW);
AA:=A^2;
B := 2*(UU + WW) + a*VV;
BB:=B^2;
AB:=(A+B)^2-AA-BB;
C := b*VV^2;
R:=2*(BB-C);
X3 := X1*(AB - R);
Z3 := Z1*(AB + R);
Y3 := Y1*(R^2 - 4*AA*C);
U3 := X3^2;
W3 := Z3^2;
T3 := U3+W3;
V3 := (X3+Z3)^2-T3;
// check:
S!(U3-X3^2); S!(V3-2*X3*Z3); S!(W3-Z3^2); S!(T3-U3-W3);
S!(x3-X3/Z3); S!(y3-Y3/Z3^2);
```