Open mmcloughlin opened 5 years ago
It seems there is some room for minor cleanup/optimization in some of these formulae. For example
https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl
XX = X12
YY = Y12
YYYY = YY2
ZZ = Z12
S = 2*((X1+YY)2-XX-YYYY)
M = 3*XX+a*ZZ2
T = M2-2*S
X3 = T
Y3 = M*(S-T)-8*YYYY
Z3 = (Y1+Z1)2-YY-ZZ
with OP3
XX = X1^2
YY = Y1^2
YYYY = YY^2
ZZ = Z1^2
t0 = X1+YY
t1 = t0^2
t2 = t1-XX
t3 = t2-YYYY
S = 2*t3
t4 = ZZ^2
t5 = a*t4
t6 = 3*XX
M = t6+t5
t7 = M^2
t8 = 2*S
T = t7-t8
X3 = T
t9 = S-T
t10 = 8*YYYY
t11 = M*t9
Y3 = t11-t10
t12 = Y1+Z1
t13 = t12^2
t14 = t13-YY
Z3 = t14-ZZ
Note that T
is not required. We could replace the following
...
T = t7-t8
X3 = T
t9 = S-T
...
with
...
X3 = t7-t8
t9 = S-X3
...
It would be useful to add some functions for analyzing EFD formulas in op3 form. Things like: inputs, outputs, parameters, operation counts etc.
Related #40