math: rewrite fma with mostly int arithmetics