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