一句话:利用数值程序的数学特性检测并修复高浮点误差,工具 AutoRNP 在 GSL 的 20 个程序中修复了 19 个。
浮点计算本质上不精确,密集使用浮点运算的数值库容易产生高浮点误差,而直接改用高精度会损失性能、甚至对精度相关的特定运算引入新误差;以重排浮点表达式或泰勒展开为主的数学重写方法,也难以处理由问题病态性(数学特性本身)引发的高浮点误差。本文提出一种高效自动修复数值库高浮点误差的方法:核心思想是利用数值程序的数学特性来检测并降低高浮点误差,关键技术包括基于两种算法的高浮点误差检测方法,以及通过推导数学函数的近似来生成补丁、满足给定修复准则的修复方法。作者实现了原型工具 AutoRNP,并在 GNU 科学计算库(GSL)的 20 个数值程序上开展实验,结果表明该工具能高效修复其中 19 个程序的高浮点误差,且在全部随机采样点上达到 100% 的准确率。
Floating point computation is by nature inexact, and numerical libraries that intensively involve floating-point computations may encounter high floating-point errors. Due to the wide use of numerical libraries, it is highly desired to reduce high floating-point errors in them. Using higher precision will degrade performance and may also introduce extra errors for certain precision-specific operations in numerical libraries. Using mathematical rewriting that mostly focuses on rearranging floating-point expressions or taking Taylor expansions may not fit for reducing high floating-point errors evoked by ill-conditioned problems that are in the nature of the mathematical feature of many numerical programs in numerical libraries. In this paper, we propose a novel approach for efficient automated repair of high floating-point errors in numerical libraries. Our main idea is to make use of the mathematical feature of a numerical program for detecting and reducing high floating-point errors. The key components include a detecting method based on two algorithms for detecting high floating-point errors and a repair method for deriving an approximation of a mathematical function to generate patch to satisfy a given repair criterion. We implement our approach by constructing a new tool called AutoRNP. Our experiments are conducted on 20 numerical programs in GNU Scientific Library (GSL). Experimental results show that our approach can efficiently repair (with 100% accuracy over all randomly sampled points) high floating-point errors for 19 of the 20 numerical programs.
@article{paperbot630,
title = {Efficient automated repair of high floating-point errors in numerical libraries},
author = {Xin Yi and Liqian Chen and Xiaoguang Mao and Tao Ji},
journal = {Proceedings of the ACM on Programming Languages},
volume = {3},
number = {POPL},
year = {2019},
doi = {10.1145/3290369}
}