source 2015 Renes--Costello--Batina "Complete addition formulas for prime order elliptic curves", Appendix A.1
parameter b3
assume b3 = 3 b
compute t0 = X1^2
compute t1 = Y1^2
compute t2 = Z1^2
compute t3 = X1 * Y1
compute t3 = t3 + t3
compute Z3 = X1 * Z1
compute Z3 = Z3 + Z3
compute X3 = a * Z3
compute Y3 = b3 * t2
compute Y3 = X3 + Y3
compute X3 = t1 - Y3
compute Y3 = t1 + Y3
compute Y3 = X3 * Y3
compute X3 = t3 * X3
compute Z3 = b3 * Z3
compute t2 = a * t2
compute t3 = t0 - t2
compute t3 = a * t3
compute t3 = t3 + Z3
compute Z3 = t0 + t0
compute t0 = Z3 + t0
compute t0 = t0 + t2
compute t0 = t0 * t3
compute Y3 = Y3 + t0
compute t2 = Y1 * Z1
compute t2 = t2 + t2
compute t0 = t2 * t3
compute X3 = X3 - t0
compute Z3 = t2 * t1
compute Z3 = Z3 + Z3
compute Z3 = Z3 + Z3