zl程序教程

您现在的位置是:首页 >  其它

当前栏目

fused multiply and add

and add
2023-09-27 14:20:25 时间

1 要解决的问题

计算x*y + z?其中x、y、z都是浮点数。

2 普通的计算方式

   e=3; s=4.734612

× e=5; s=5.417242

-----------------------

   e=8; s=25.648538980104 (true product)

   e=8; s=25.64854 (after rounding)

   e=9; s=2.564854 (after normalization)

在normalization之后,再去加z,得到的结果再进行一次rounding和normalization。

3 fma的计算方式

直接用true product和z相加,得到的结果进行一次rounding和normalization就得到最终的结果了。

 

4 两种方式比较

普通方式要进行两次rounding,因此精度损失的更多。

 

5 它们具体的实现是芯片层面的事情了

暂放。