Skip to content

Commit

Permalink
better fast inv sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
sebseb7 committed Dec 13, 2012
1 parent 3c966b3 commit 4340601
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fastsqrt_version2
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 4340601

Please sign in to comment.