Modified Fast Inverse Square Root and Square Root Approximation Algorithms: The Method of Switching Magic Constants
نویسندگان
چکیده
Many low-cost platforms that support floating-point arithmetic, such as microcontrollers and field-programmable gate arrays, do not include fast hardware or software methods for calculating the square root and/or reciprocal root. Typically, functions are implemented using direct lookup tables polynomial approximations, with a subsequent application of Newton–Raphson method. Other, more complex solutions high-radix digit-recurrence bipartite multipartite table-based methods. In contrast, this article proposes simple modification inverse method has high accuracy relatively low latency. Algorithms given in C/C++ single- double-precision numbers IEEE 754 format both functions. These based on switching magic constants initial approximation, depending input interval normalized numbers, order to minimize maximum relative error each subinterval after first iteration—giving 13 correct bits result. Our experimental results show proposed algorithms provide fairly good trade-off between latency two iterations type float, three double when fused multiply–add instructions—giving almost complete accuracy.
منابع مشابه
Improving the accuracy of the fast inverse square root algorithm
We present improved algorithms for fast calculation of the inverse square root for single-precision floating-point numbers. The algorithms are much more accurate than the famous fast inverse square root algorithm and have the same or similar computational cost. The main idea of our work consists in modifying the NewtonRaphson method and demanding that the maximal error is as small as possible. ...
متن کاملFast calculation of inverse square root with the use of magic constant - analytical approach
We present a mathematical analysis of transformations used in fast calculation of inverse square root for single-precision floating-point numbers. Optimal values of the so called magic constants are derived in a systematic way, minimizing either absolute or relative errors at subsequent stages of the discussed algorithm.
متن کاملFast Floating Point Square Root
Hain and Freire have proposed different floating point square root algorithms that can be efficiently implemented in hardware. The algorithms are compared and evaluated on both performance and precision.
متن کاملHigh-Speed Double-Precision Computation of Reciprocal, Division, Square Root and Inverse Square Root
A new method for the high-speed computation of double-precision floating-point reciprocal, division, square root, and inverse square root operations is presented in this paper. This method employs a second-degree minimax polynomial approximation to obtain an accurate initial estimate of the reciprocal and the inverse square root values, and then performs a modified Goldschmidt iteration. The hi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Computation (Basel)
سال: 2021
ISSN: ['2079-3197']
DOI: https://doi.org/10.3390/computation9020021