Об одном р-адическом представлении чисел с плавающей точкой
Оцоков Шамиль Алиевич, Алексей Алексеевич Мишин, Магомед Абдулаевич Сурхаев · Vestnik MEI · 2025
The purpose of the work is to develop and study an approach based on p-adic numbers for problems where conventional floating-point arithmetic demonstrates a loss of accuracy, in particular, when performing computations with numbers that differ greatly from each other in order and when subtracting numbers close to each other in value. The work methodology is based on a theoretical analysis of the p-adic representation of floating-point numbers and a theoretical and experimental study of its behavioral properties with limited accuracy. For the p-adic representation based on Hansel codes, formulas are presented for estimating the range of representable rational numbers and the representation accuracy depending on the p-adic representation parameters (the number p, the length of the mantissa r). The features of the p-adic representation of numbers are considered, in particular, the fact that rounding is performed without distortion of the lower digits due to the direction during bitwise transfer operations. The results of experiments conducted in the SageMath environment have shown that the use of p-adic arithmetic, when calculating the scalar product of vectors with very differing coordinates provides an accurate result, while the standard floating-point arithmetic demonstrates a dramatic loss of accuracy. It has theoretically been shown that if one of the two norms of the difference between two floating-point numbers close to each other in value is less than unity (real or p-adic), then the other one is greater than unity, which allows one to automatically select a more accurate result when subtracting numbers close in value and reduce the risk of loss of accuracy. The difference in the p-adic representation topology in comparison with real numbers makes it possible to use this representation as an additional tool for clarifying the results when subtracting numbers close to each other in value or calculations with numbers differing from each other in order.
Cited by 0 works.