Rigorous Error Analysis for Logarithmic Number Systems
Thanh Son Nguyen, Alexey Solovyev, Ganesh Gopalakrishnan
TL;DR
This work addresses the lack of tight worst-case error bounds for Logarithmic Number Systems (LNS) used in high-dynamic-range computing. It develops a rigorous, parametric framework to bound errors arising from three core LNS techniques—first-order Taylor interpolation, error-correction, and co-transformation—across both $\Phi^+(x)$ and $\Phi^-(x)$ mappings, with explicit dependence on fixed-point epsilon $\epsilon$, table spacings $\Delta$, and related parameters. The authors prove and combine multiple lemmas and theorems to yield comprehensive bounds, then validate them via a Python implementation showing the bounds are tight and conservative. They also discuss adaptations to other bases and practical impacts for hardware/software design, including ROM-table sizing and proof-checking directions. Overall, the paper provides a principled, actionable foundation to design and verify LNS arithmetic with guaranteed accuracy bounds, reducing over-provisioning in HPC/ML hardware.
Abstract
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.
