From e92e9d4f04ecd6f03879b4a88b1551bb32a9361b Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 29 Jul 2018 19:31:12 +0000 Subject: [PATCH] "Lomont then searched for a constant optimal even after one and two Newton iterations and found 0x5F375A86, which is more accurate than the original at every iteration stage." git-svn-id: https://svn.eduke32.com/eduke32@6958 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/polymost.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index 8ad9e20e0..34e61dcaa 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -159,7 +159,7 @@ static inline float polymost_invsqrt_approximation(float x) #ifdef B_LITTLE_ENDIAN float const haf = x * .5f; struct conv { union { uint32_t i; float f; } ; } * const n = (struct conv *)&x; - n->i = 0x5f3759df - (n->i >> 1); + n->i = 0x5f375a86 - (n->i >> 1); return n->f * (1.5f - haf * (n->f * n->f)); #else // this is the comment