How to use the model from Python
> curl -s "https://ehw.fit.vutbr.cz/evoapproxlib/v1.2022?folder=multiplers/12x12_signed/pareto_pwr_mse&file=mul12s_2TE.c&pyx=bash" | bash
> python
import pyximport; pyximport.install()
import mul12s_2TE
def u2s(v):
if v & 8388608:
return v - 16777216
return v
wce = e = 0
for i in range(-2**11,2**11):
for j in range(-2**11,2**11):
diff = abs(u2s(mul12s_2TE.mul(i,j)) - (i*j))
if diff > wce: wce = diff
e += diff
print('average error magnitude (mae)',e/(2.0**(24)))
print('worst-case error magnitude (wce)',wce)