浮点倒数、除法与平方根的不精确性及校正
Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root
AI总结:
本文提出了一族可校正倒数、除法和平方根近似值并实现IEEE-754正确舍入的硬件算法,同时证明就近舍入到偶数模式下无需相等性测试。
摘要:
浮点算术性能决定了从图形学到人工智能等重要应用的整体性能。满足IEEE-754浮点规范要求加法、减法、乘法、除法和平方根的最终结果必须根据用户选择的舍入模式进行正确舍入。令实现者感到沮丧的一个事实是,即使可以获得具有更高准确度和精度的中间结果,朴素的舍入方法也无法产生正确舍入的结果。相比之下,我们的新算法能够校正倒数、除法和平方根的近似值,即使是精度略低于目标精度的近似值。在本文中,我们提出了一族算法,这些算法既能提高估计值的准确度(并可能提高其精度),又能根据所有二进制IEEE-754舍入模式对其进行正确舍入。我们解释了如何在硬件中高效实现该算法,并且为了完整性,我们给出了证明:对于倒数、除法和平方根函数,没有必要包含与就近舍入到偶数模式相关的相等性测试,因为在给定精度下,输入不可能具有恰好位于该精度下可表示浮点数正中间的精确答案。事实上,我们更简洁的证明有时更强。
英文摘要:
Floating-point arithmetic performance determines the overall performance of important applications, from graphics to AI. Meeting the IEEE-754 specification for floating-point requires that final results of addition, subtraction, multiplication, division, and square root are correctly rounded based on the user-selected rounding mode. A frustrating fact for implementers is that naive rounding methods will not produce correctly rounded results even when intermediate results with greater accuracy and precision are available. In contrast, our novel algorithm can correct approximations of reciprocal, division and square root, even ones with slightly lower than target precision. In this paper, we present a family of algorithms that can both increase the accuracy (and potentially the precision) of an estimate and correctly round it according to all binary IEEE-754 rounding modes. We explain how it may be efficiently implemented in hardware, and for completeness, we present proofs that it is not necessary to include equality tests associated with round-to-nearest-even mode for reciprocal, division and square root functions, because it is impossible for input(s) in a given precision to have exact answers exactly midway between representable floating-point numbers in that precision. In fact, our simpler proofs are sometimes stronger.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。