一种新的生成浮点表示的正确舍入数学库的方法
A Novel Approach to Generate Correctly Rounded Math Libraries for New Floating Point Representations
摘要:
鉴于浮点~(FP)性能在许多领域中的重要性,已经提出了FP的几种新变体及其替代方案(例如,Bfloat 16、TensorFloat 32和Posits)。这些表示法没有正确舍入的数学库。此外,将现有FP库用于这些新表示可能会产生不正确的结果。本文提出了一种新的方法来生成多项式近似,可用于实现正确的舍入数学库。现有方法生成逼近初等函数$f(x)$实值的多项式,并由于实现中的逼近误差和舍入误差而产生错误的结果。相反,我们的方法生成近似$f(x)$的正确舍入值的多项式(即,将$f(x)$的值舍入到目标表示)。它提供了更多的余量来识别有效的多项式,这些多项式为所有输入产生正确的舍入结果。我们框架的问题产生有效的多项式,产生正确的四舍五入的结果作为一个线性规划问题。我们的方法保证,我们产生正确的结果,即使范围缩小技术。使用我们的方法,我们已经制定了正确的四舍五入,但更快,实现多个目标表示的基本功能。
英文摘要:
Given the importance of floating-point~(FP) performance in numerous domains, several new variants of FP and its alternatives have been proposed (e.g., Bfloat16, TensorFloat32, and Posits). These representations do not have correctly rounded math libraries. Further, the use of existing FP libraries for these new representations can produce incorrect results. This paper proposes a novel approach for generating polynomial approximations that can be used to implement correctly rounded math libraries. Existing methods generate polynomials that approximate the real value of an elementary function $f(x)$ and produce wrong results due to approximation errors and rounding errors in the implementation. In contrast, our approach generates polynomials that approximate the correctly rounded value of $f(x)$ (i.e., the value of $f(x)$ rounded to the target representation). It provides more margin to identify efficient polynomials that produce correctly rounded results for all inputs. We frame the problem of generating efficient polynomials that produce correctly rounded results as a linear programming problem. Our approach guarantees that we produce the correct result even with range reduction techniques. Using our approach, we have developed correctly rounded, yet faster, implementations of elementary functions for multiple target representations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。