Logarithmic Number Systems (LNS) hold considerable promise in helping reduce the number of bits needed to represent a high dynamic range of real-numbers with finite precision, and also efficiently support multiplication and division. However, under LNS, addition and subtraction turn into non-linear functions that must be approximated - typically using precomputed table-based functions. Additionally, multiple layers of error correction are typically needed to improve result accuracy. Unfortunately, previous efforts have not characterized the resulting error bound. We provide the first rigorous analysis of LNS, covering detailed techniques such as co-transformation that are crucial to implementing subtraction with reasonable accuracy. We provide theorems capturing the error due to table interpolations, the finite precision of pre-computed values in the tables, and the error introduced by fix-point multiplications involved in LNS implementations. We empirically validate our analysis using a Python implementation, showing that our analytical bounds are tight, and that our testing campaign generates inputs diverse-enough to almost match (but not exceed) the analytical bounds. We close with discussions on how to adapt our analysis to LNS systems with different bases and also discuss many pragmatic ramifications of our work in the broader arena of scientific computing and machine learning.
翻译:对数数制(LNS)在减少用有限精度表示高动态范围实数所需的比特数方面具有显著潜力,并能高效支持乘法和除法运算。然而,在LNS中,加法和减法转化为必须近似的非线性函数——通常采用预计算查找表函数。此外,通常需要多层纠错来提高结果精度。遗憾的是,以往研究并未给出此类误差界的量化特征。我们首次对LNS进行了严格分析,覆盖了共变换等关键细节技术,这些技术对以合理精度实现减法至关重要。我们提出了描述查找表插值误差、表内预计算值的有限精度误差以及LNS实现中定点乘法引入误差的定理。通过Python实现进行实证验证,证明我们的分析界是紧致的,且测试流程生成的输入多样性足以近乎匹配(但未超过)分析界。最后,我们探讨了如何将分析推广至不同基数的LNS系统,并讨论了本工作在科学计算与机器学习广阔领域中的诸多实际意义。