一句话:提出源到源编译器Rosa,可根据误差规约将实数程序自动合成浮点或定点代码,并统一估计舍入误差。
数值软件常使用有限精度近似实数运算,舍入误差与测量误差导致结果不确定,安全关键应用亟需工具辅助数据类型选择与精度评估。本文提出源到源编译器Rosa,输入带误差规约的实数程序,自动合成合适的浮点或定点代码。其核心是统一的有界舍入误差估计技术,可处理非线性算术、无界循环的闭式符号不变量,并量化不连续性的影响。在科学计算与嵌入式基准上评估,与最先进的自动误差估计方法相比,Rosa在精度与性能之间呈现出有趣的权衡。
Numerical software, common in scientific computing or embedded systems, inevitably uses a finite-precision approximation of the real arithmetic in which most algorithms are designed. In many applications, the roundoff errors introduced by finite-precision arithmetic are not the only source of inaccuracy, and measurement and other input errors further increase the uncertainty of the computed results. Adequate tools are needed to help users select suitable data types and evaluate the provided accuracy, especially for safety-critical applications. We present a source-to-source compiler called Rosa that takes as input a real-valued program with error specifications and synthesizes code over an appropriate floating-point or fixed-point data type. The main challenge of such a compiler is a fully automated, sound, and yet accurate-enough numerical error estimation. We introduce a unified technique for bounding roundoff errors from floating-point and fixed-point arithmetic of various precisions. The technique can handle nonlinear arithmetic, determine closed-form symbolic invariants for unbounded loops, and quantify the effects of discontinuities on numerical errors. We evaluate Rosa on a number of benchmarks from scientific computing and embedded systems and, comparing it to the state of the art in automated error estimation, show that it presents an interesting tradeoff between accuracy and performance.