Abstract

Direct computation of functions using low-complexity algorithms can be applied both for hardware constraints and in systems where storage capacity is a challenge for processing a large volume of data. We present improved algorithms for fast calculation of the inverse square root function for single-precision and double-precision floating-point numbers. Higher precision is also discussed. Our approach consists in minimizing maximal errors by finding optimal magic constants and modifying the Newton–Raphson coefficients. The obtained algorithms are much more accurate than the original fast inverse square root algorithm and have similar very low computational costs.

Highlights

  • Approximations of elementary functions are crucial in scientific computing, computer graphics, signal processing, and other fields of engineering and science [7,8,9,10]

  • InvSqrt1) of the fast inverse square root. It will be developed and generalized where we will show how to increase the accuracy of the InvSqrt code without losing its advantages, including the low computational cost

  • We focus on the Newton–Raphson corrections, which form the second part of the InvSqrt code

Read more

Summary

Introduction

The main idea of the algorithm InvSqrt consists in interpreting bits of the input floating-point number as an integer [31]. In [31], we have shown that if e R = 12 ( B − 1) (e.g., e R = 63 in the 32-bit case), the function (3) (defined on integers) is equivalent to the following piece-wise linear function (when interpreted in terms of corresponding floating-point numbers):. Following and developing ideas presented in our recent papers [31,32], we propose modifications of the Newton–Raphson formulas, which result in algorithms that have the same or similar computational cost as/to InvSqrt, but improve the accuracy of the original code, even by several times.

Modified Newton–Raphson Formulas
Algorithm InvSqrt1
InvSqrt2 Algorithm
InvSqrt3 Algorithm
Subnormal Numbers
Higher Precision
Numerical Experiments
Findings
Conclusions
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.