一句话:提出 Arfa,将浮点表达式定义域划分为 regime 并进行重写,以降低舍入误差。
浮点表达式因舍入误差而偏离精确结果,现有优化方法难以兼顾搜索效率与精度。Arfa 将表达式定义域 D 划分为多个 regime,并针对误差较大的 regime 重写表达式:先寻找在整个 D 上误差更低的替换式 fo 并利用其误差分布推断有效 regime;再在每个感兴趣的 regime 内生成不完整的、有序的重写候选集,以高效搜索最佳替换;最后检查排名靠前候选的误差并兼顾精度提升来选择最优重写。在 56 个 FPbench 例子和 4 个真实程序上,Arfa 平均将最大和平均误差降低 4.73 和 2.08 位(最高 33 和 16 位),且误差常低于 Herbie 和 NumOpt。
We introduce a floating-point (FP) error optimization approach called Arfa that partitions the domain D of an FP expression fe into regimes and rewrites fe in each regime where fe shows larger errors. First, Arfa seeks a rewrite substitution fo with lower errors across D, whose error distribution is plotted for effective regime inference. Next, Arfa generates an incomplete set of ordered rewrite candidates within each regime of interest, so that searching for the best rewrite substitutions is performed efficiently. Finally, Arfa selects the best rewrite substitution by inspecting the errors of top ranked rewrite candidates, with enhancing precision also considered. Experiments on 56 FPbench examples and four real-life programs show that Arfa not only reduces the maximum and average errors of fe by 4.73 and 2.08 bits on average (and up to 33 and 16 bits), but also exhibits lower errors, sometimes to a significant degree, than Herbie and NumOpt.
DOI 原文 ·
@inproceedings{paperbot8571,
title = {Arfa: An Agile Regime-Based Floating-Point Optimization Approach for Rounding Errors},
author = {Jinchen Xu and Mengqi Cui and Fei Li and Zuoyan Zhang and Hongru Yang and Bei Zhou and Jie Zhao},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3680378}
}