Skip to content

Instantly share code, notes, and snippets.

View wavim's full-sized avatar
💫
Gazing ✦ Stars⠀

David wavim

💫
Gazing ✦ Stars⠀
  • Laniakea Complex
View GitHub Profile
@wavim
wavim / sqrt.c
Last active October 10, 2025 11:23
Fast Floating Point Root
float sqrt(float x)
{
int i = * (int * ) & x;
int j = 0x1fbb4f2e + (i >> 1);
float a0 = * (float * ) & j;
float t0 = a0 + x / a0;
return x / t0 + t0 / 4;
}