One Polynomial Approximation to Produce Correctly Rounded Results of an Elementary Function for Multiple Representations and Rounding Modes

PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL(2022)

引用 7|浏览6
暂无评分
摘要
Mainstream math libraries for floating point (FP) do not produce correctly rounded results for all inputs. In contrast, CR-LIBM and RLibm provide correctly rounded implementations for a specific FP representation with one rounding mode. Using such libraries for a representation with a new rounding mode or with different precision will result in wrong results due to double rounding. This paper proposes a novel method to generate a single polynomial approximation that produces correctly rounded results for all inputs for multiple rounding modes and multiple precision configurations. To generate a correctly rounded library for..-bits, our key idea is to generate a polynomial approximation for a representation with n + 2-bits using the round-to-odd mode. We prove that the resulting polynomial approximation will produce correctly rounded results for all five rounding modes in the standard and for multiple representations with.. -bits such that vertical bar E vertical bar + 1 < k <= n, where vertical bar E vertical bar is the number of exponent bits in the representation. Similar to our prior work in the RLibm project, we approximate the correctly rounded result when we generate the library with n + 2-bits using the round-to-odd mode. We also generate polynomial approximations by structuring it as a linear programming problem but propose enhancements to polynomial generation to handle the round-to-odd mode. Our prototype is the first 32-bit float library that produces correctly rounded results with all rounding modes in the IEEE standard for all inputs with a single polynomial approximation. It also produces correctly rounded results for any FP configuration ranging from 10-bits to 32-bits while also being faster than mainstream libraries.
更多
查看译文
关键词
floating point, round-to-odd, correctly rounded math libraries
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要