From 4340601e1c2f604161a3830de98fe7ce5ae8ff05 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Thu, 13 Dec 2012 14:26:53 +0100 Subject: [PATCH] better fast inv sqrt --- fastsqrt_version2 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 fastsqrt_version2 diff --git a/fastsqrt_version2 b/fastsqrt_version2 new file mode 100644 index 0000000..054fb34 --- /dev/null +++ b/fastsqrt_version2 @@ -0,0 +1,5 @@ +float InvSqrt(float x){ + uint32_t i = 0x5F1F1412 - (*(uint32_t*)&x >> 1); + float tmp = *(float*)&i; + return tmp * (1.69000231f - 0.714158168f * x * tmp * tmp); +}