paperbot · PL 论文追踪

全部论文 待读 收藏

P0 One polynomial approximation to produce correctly rounded results of an elementary function for multiple representations and rounding modes

一种多项式逼近:为多种表示与舍入模式生成初等函数的正确舍入结果
POPL 6(POPL)2022匹配度 8/10 · 论文属于正确舍入初等函数库的生成方法,核心涉及浮点表示、舍入模式与多项式逼近的可靠性证明,正落在用户画像中的“浮点程序分析”方向;其兼具形式化证明与工程原型、并强调工业可用性(比主流库更快),符合用户偏好,只是不涉及 LLM 交叉。引用 15 inbox
Jay P. Lim, Santosh Nagarakatte
crossref: 2026-09-10

AI 速览

一句话:提出用 n+2 位 round-to-odd 多项式逼近,一次生成支持多种精度与全部 IEEE 舍入模式的正确舍入初等函数库。

主流浮点数学库不能对所有输入给出正确舍入结果;现有 CR-LIBM/RLIBM 只针对特定表示和单一舍入模式,换精度或舍入模式会因双重舍入出错。本文提出生成单个多项式逼近的方法:为 n 位表示生成 n+2 位、采用 round-to-odd 模式的多项式,并证明该逼近对 IEEE 五种舍入模式以及满足 |E|+1<k≤n 的多种 k 位表示均正确舍入。作者将多项式生成建模为线性规划,并针对 round-to-odd 模式改进生成算法。原型是首个用单个多项式逼近对所有输入、所有 IEEE 舍入模式产出正确舍入结果的 32 位浮点库,还支持 10 到 32 位配置,且比主流库更快。

问题
主流浮点数学库无法对所有输入产生正确舍入结果;已有的 CR-LIBM/RLIBM 只针对特定浮点表示和单一舍入模式,换精度或舍入模式会因双重舍入而出错。
方法
为 n 位表示生成 n+2 位、采用 round-to-odd 模式的单个多项式逼近,并证明其对 IEEE 五种舍入模式及满足 |E|+1<k≤n 的 k 位表示均正确;多项式生成被构造为线性规划并针对 round-to-odd 模式增强。
评估
原型是首个用单个多项式逼近为所有输入、所有 IEEE 舍入模式产生正确舍入结果的 32 位浮点库,同时支持 10 到 32 位配置,并比主流库更快。
原文摘要(Abstract)

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 n -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 k -bits such that | E | +1 < k ≤ n , where | E | 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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1535,
  title = {One polynomial approximation to produce correctly rounded results of an elementary function for multiple representations and rounding modes},
  author = {Jay P. Lim and Santosh Nagarakatte},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {POPL},
  year = {2022},
  doi = {10.1145/3498664}
}