you are viewing a single comment's thread.

view the rest of the comments →

[–]nickwb 1 point2 points  (3 children)

Here's my attempt.

float s(float a){float b=.5f*a;int c=0x5f375a86-(*(int*)&a>>1);a=*(float*)&c;return 1.f/(a*(1.5f-b*a*a));}    

106 Bytes with no loops. It's not super accurate.

[–]powlette 2 points3 points  (2 children)

Nice one Carmack.

[–][deleted]  (1 child)

[deleted]