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 它们具体的实现是芯片层面的事情了

暂放。

 

相关文章:

  • 2021-10-27
  • 2021-10-08
  • 2022-03-04
  • 2022-12-23
  • 2021-04-10
  • 2021-05-26
  • 2021-06-21
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-07-19
  • 2021-11-21
  • 2021-11-18
相关资源
相似解决方案