source 1986 Chudnovsky--Chudnovsky "Sequences of numbers generated by addition in formal groups and new primality and factorization tests", formula (4.9i), plus common-subexpression elimination
compute Z1C2 = Z1 C2
compute S1D2 = S1 D2
compute D1S2 = D1 S2
compute C1Z2 = C1 Z2
compute S3 = Z1C2 S1D2+D1S2 C1Z2
compute C3 = Z1C2 C1Z2-D1S2 S1D2
compute D3 = Z1 D1 Z2 D2-a S1 C1 S2 C2
compute Z3 = Z1C2^2+D1S2^2