November 30, 2009
I’m enrolling for PhD
Guest question from Logik. Thanks dude! Your
GQHero trophy has been delivered to your house ;)
Connect
Cracked by: sidsen , Raghuvansh , Jean Valjean , krudebox , Dibyo , yaksha , Logik , shashank , shrik , Ps , SV , joe , udupendra , shenoyvarun86 , Rogi , p vs np , byslexia , AC , akhi , umang , madhur , Anubhav and Ananth
Answer:
The super fast inverse square root function from Q3A. Contrary to what many of you think, this piece of code was _not_ written by Carmack. See this http://www.beyond3d.com/content/articles/8/
Quoting Logik for details
The strip makes a reference to the Newton method for calculating inverse square roots.
from:
http://www.explainxkcd.com/2009/11/18/academia-
vs-business/
0×5f375a86 is the value used in the algorithm to approximate the solution to the square root of an unsigned floating number, also known as fast inverse square root.
The solution uses an ingenious first approximation and the difficult problem was solved without any fanfare (like in the cartoon) for the game, Quake III Arena.
0×5f3759df is also used, which is found to be less accurate.
http://en.wikipedia.org/wiki/F…..quare_root




Subscribe
December 1st, 2009 at 3:07 am, GMT +0000 ( 1259636831 )
fast inverse square root
December 1st, 2009 at 3:44 am, GMT +0000 ( 1259639077 )
Fast inverse square root, aka 0x5f3759df – implemented in the Quake III code, using Newton’s method. Referenced in the xkcd comic shown.
December 1st, 2009 at 4:00 am, GMT +0000 ( 1259640031 )
one of the famous examples of an elegant piece of code locked away in proprietary source code is the fast inverse square root method(0x5f375a86) which was used in Quake 3. The connection to Newton being that the algorithm generates reasonably accurate results using a unique first approximation for Newton\’s method for finding roots of real valued functions.
December 1st, 2009 at 5:15 am, GMT +0000 ( 1259644509 )
Carmack’s Unusual Inverse Square Root or 0x5f375a86 is the algorithm to approximate the solution to the square root of an unsigned floating number, also known as fast inverse square root.
The solution uses an ingenious first approximation for Newton’s method and the difficult problem was solved without any fanfare (like in the xkcd cartoon) for the game, Quake III Arena.
December 1st, 2009 at 6:11 am, GMT +0000 ( 1259647861 )
0×5f3759df.
john carmack is god, twice over, now.
December 1st, 2009 at 7:03 am, GMT +0000 ( 1259650997 )
quakes fast invsqrt()
December 1st, 2009 at 7:30 am, GMT +0000 ( 1259652620 )
The strip makes a reference to the Newton method for calculating inverse square roots.
from:
http://www.explainxkcd.com/2009/11/18/academia-
vs-business/
0x5f375a86 is the value used in the algorithm to approximate the solution to the square root of an unsigned floating number, also known as fast inverse square root.
The solution uses an ingenious first approximation and the difficult problem was solved without any fanfare (like in the cartoon) for the game, Quake III Arena.
0x5f3759df is also used, which is found to be less accurate.
http://en.wikipedia.org/wiki/F.....quare_root
December 1st, 2009 at 9:06 am, GMT +0000 ( 1259658383 )
0x5f3759df or Fast inverse square root
December 1st, 2009 at 9:25 am, GMT +0000 ( 1259659521 )
0x5f375a86 (from the alt-text) of xkcd 664 s the algorithm to approximate the solution to the square root of an unsigned floating number, also known as fast inverse square root. The solution uses an ingenious first approximation of Newton’s Method and the difficult problem was solved without any fanfare for the game, Quake III Arena.
Largely taken from explainxkcd – xkcd connects are too easy ‘cos of that site :D
December 1st, 2009 at 9:38 am, GMT +0000 ( 1259660332 )
0×5f3759df
Newtons Approximation of roots a concept that quake ever so happily uses
December 1st, 2009 at 9:52 am, GMT +0000 ( 1259661176 )
Just in case the solution is supposed to be bigger
http://forums.xkcd.com/viewtop.....8;start=80
December 1st, 2009 at 10:18 am, GMT +0000 ( 1259662712 )
The fast inverse square root method used in Quake III is good first guess used with Newtons approximation, which got onto xkcd
December 1st, 2009 at 10:30 am, GMT +0000 ( 1259663430 )
The fast inverse sq. root method by John Cormack, used in quake 3, referenced in the xkcd alt text and uses Newton’s method.
December 1st, 2009 at 11:31 am, GMT +0000 ( 1259667102 )
Fast inverse square root – used in Quake III, the hexcode appeared in the xkcd alttext and it is derived from the Newton’s method of approximation
December 1st, 2009 at 6:29 pm, GMT +0000 ( 1259692153 )
Straight from explainxkcd.com
(p=np problem) 0x5f375a86 is the algorithm to approximate the solution to the square root of an unsigned floating number, also known as fast inverse square root(Newton’s method). The solution uses an ingenious first approximation and the difficult problem was solved without any fanfare (like in the cartoon) for the game, Quake III Arena.
December 1st, 2009 at 8:24 pm, GMT +0000 ( 1259699073 )
Is *0x5f3759df* enough of an answer?
(Though *0x5f375a86* is a more accurate value for use in Newton approximations for fast inverse square root operations.)
December 1st, 2009 at 9:49 pm, GMT +0000 ( 1259704157 )
The title of that XKCD strip is:
“Some engineer out there has solved P=NP and it’s locked up in an electric eggbeater calibration routine. For every 0x5f375a86 we learn about, there are thousands we never see.”
The 0x5f375a86 is a reference to Carmack’s implementation of the FInvSqrt() in Quake III Arena. The transformation is based on of Newton’s many approximations.
Nice question :)
December 1st, 2009 at 11:38 pm, GMT +0000 ( 1259710708 )
Fast inverse square root algorithm.
Famously used in Quake 3, referenced by xkcd. The algorithm uses Newton’s method.
December 1st, 2009 at 11:47 pm, GMT +0000 ( 1259711265 )
Good one!
Connect : the magic number 0x5f3759df
1) The number is used by John Carmack in Quake source code while calculating inverse square root.
2) The number is used in the title text of that xkcd strip.
3) The number is used as a first guess in the first iter of Newton’s approx of roots method.
December 2nd, 2009 at 5:10 am, GMT +0000 ( 1259730607 )
the very fast inverse square root subroutine by Carmack.
December 2nd, 2009 at 7:39 am, GMT +0000 ( 1259739547 )
Fast inverse square root function
December 2nd, 2009 at 9:24 am, GMT +0000 ( 1259745844 )
Fast Inverse Square root!
December 2nd, 2009 at 10:05 am, GMT +0000 ( 1259748358 )
Connect – Fast inverse square root
1. quake 3 implements a specific fast inverse square root function which attracted a lot of attention for being clever
2. magic number in same is referenced in the xkcd comic.
the comic itself also loosely refers to a similar situation.
3. Newton’s method for finding roots is used in the same.
December 2nd, 2009 at 10:44 am, GMT +0000 ( 1259750681 )
The square root code that is hidden inside Quake. John Carmack.