当前位置: X-MOL 学术ACM Trans. Math. Softw. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
CPFloat: A C Library for Simulating Low-precision Arithmetic
ACM Transactions on Mathematical Software ( IF 2.7 ) Pub Date : 2023-06-17 , DOI: https://dl.acm.org/doi/10.1145/3585515
Massimiliano Fasi, Mantas Mikaitis

One can simulate low-precision floating-point arithmetic via software by executing each arithmetic operation in hardware and then rounding the result to the desired number of significant bits. For IEEE-compliant formats, rounding requires only standard mathematical library functions, but handling subnormals, underflow, and overflow demands special attention, and numerical errors can cause mathematically correct formulae to behave incorrectly in finite arithmetic. Moreover, the ensuing implementations are not necessarily efficient, as the library functions these techniques build upon are typically designed to handle a broad range of cases and may not be optimized for the specific needs of rounding algorithms. CPFloat is a C library for simulating low-precision arithmetics. It offers efficient routines for rounding, performing mathematical computations, and querying properties of the simulated low-precision format. The software exploits the bit-level floating-point representation of the format in which the numbers are stored and replaces costly library calls with low-level bit manipulations and integer arithmetic. In numerical experiments, the new techniques bring a considerable speedup (typically one order of magnitude or more) over existing alternatives in C, C++, and MATLAB. To our knowledge, CPFloat is currently the most efficient and complete library for experimenting with custom low-precision floating-point arithmetic.



中文翻译:

CPFloat:用于模拟低精度算术的 AC 库

通过在硬件中执行每个算术运算,然后将结果四舍五入到所需的有效位数,可以通过软件模拟低精度浮点算术。对于符合 IEEE 标准的格式,舍入只需要标准数学库函数,但处理次正规、下溢和上溢需要特别注意,数值错误会导致数学上正确的公式在有限算术中表现不正确。此外,随后的实施不一定有效,因为这些技术所基于的库函数通常设计用于处理广泛的情况,并且可能未针对舍入算法的特定需求进行优化。CPFloat 是一个用于模拟低精度算术的 C 库。它提供了高效的舍入例程,执行数学计算,并查询模拟的低精度格式的属性。该软件利用数字存储格式的位级浮点表示,并用低级位操作和整数运算代替昂贵的库调用。在数值实验中,新技术比 C、C++ 和 MATLAB 中的现有替代方法带来了相当大的加速(通常是一个数量级或更多)。据我们所知,CPFloat 是目前用于试验自定义低精度浮点算法的最有效和最完整的库。该软件利用数字存储格式的位级浮点表示,并用低级位操作和整数运算代替昂贵的库调用。在数值实验中,新技术比 C、C++ 和 MATLAB 中的现有替代方法带来了相当大的加速(通常是一个数量级或更多)。据我们所知,CPFloat 是目前用于试验自定义低精度浮点算法的最有效和最完整的库。该软件利用数字存储格式的位级浮点表示,并用低级位操作和整数运算代替昂贵的库调用。在数值实验中,新技术比 C、C++ 和 MATLAB 中的现有替代方法带来了相当大的加速(通常是一个数量级或更多)。据我们所知,CPFloat 是目前用于试验自定义低精度浮点算法的最有效和最完整的库。

更新日期:2023-06-19
down
wechat
bug