hex.mul¶
`for n==b/2: n^2(5.5@+20)`
res[:n] = a[:n] * b[:n]
b is the minimum of #on-bits in a,b (b<n/2 on average, e.g. b=7 for n=16).
Signature¶
def mul n, res, a, b @ a_less_1bits, b_less_1bits, loop, after_add, dst, src, a_1bits, b_1bits, end { ... }
Defined in hex/mul.fj — lines 39–73 (view on GitHub).
Complexity¶
Time:
n^2(3@+7) + n*b(5@+26)Space:
n(21@+479)
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires init¶
The following must be initialised before this macro is invoked:
hex.add.init (or hex.init)