John Carmack

John Carmack (born on August 20th 1970) is the principal programmer and the cofounder (with several people, of which John Romero) of the company Id Software , a company of development of video games. Its skill in data-processing Programmation enabled him to become a celebrity in the community of the Joueur S.

The first play developed by Id Software , was Commander Keen . John Carmack is in the beginning many subjective plays of shooting such as: Wolfenstein 3D , Doom and Quake , which plunges the player in a universe in three dimensions and put it in the skin of a quarrelsome character. More recently, it developed Doom 3 whose graphic engine is with the point of current technology. He invented several algorithms (of which the Carmack' S Reverse that he is not makes the first of it be imagined), and he was the first to develop graphic engines able to exploit to the maximum the evolutions of the material, in particular of the graphics cards for PC, the generation of images 3D in Système real-time. Quake also innovated thanks to the possibility of playing several in real-time, by the means of Internet.

In 2001, it joined the Pantheon of the developers ( Hall off Famed ) of the Académie of Arts and Sciences Interactives.

Amateur of rocket S, he is founder of the company Armadillo Aerospace.

0x5f3759df

Quake 3 Arena being under license LPG, it is possible to consult the entirety of the source code of this play. Among this one, one finds two functions allotted a long time to John Carmack and which will have made much speak about them: one to calculate a square Root, the other to calculate the reverse of a square root.

Written in C, the function calculating the reverse of a square root is the following one:

float Q_rsqrt (float number) { length I; float x2, there; const float threehalfs = 1.5F; x2 = number * 0.5F; there = number; I = * (long *) &y; // evil floating not bit level hacking I = 0x5f3759df - (I >> 1); // what the fuck? there = * (float *) &i; there = there * (threehalfs - (x2 * there * there)); // 1st iteration // there = there * (threehalfs - (x2 * there * there)); // 2nd iteration, this edge Be removed #ifndef Q3_VM #ifdef __linux assert (! isnan (there)); // bk010122 - FPE? #endif #endif return there; }

This function is at the very least particular since it does not contain any loop, it utilizes only one continuation of elementary calculations! For as much, this one provides completely acceptable approximations (about 10 -3 ). It is even up to 4 times faster than the function sqrt (float X) and appears thus perfect for a video game.

Actually, this function rests on a method drawn from the numerical Analyze: the Method of Newton. The key of its effectiveness resides in the use of a particular constant 0x5f3759df . This constant Hexadécimal E is used like first approximation and reduced in a remarkable way the iteration count necessary to obtain a satisfactory approximation. This constant - said magic - is so remarkable that only one iteration is in fact necessary!

Chris Lomont of the university of Purdue since studied the question. There exists a constant providing of better approximations: 0x5f375a86 . In its study, Chris Lomont also makes mention owing to the fact that the original use of this constant would perhaps have with Gary Tarolli, then developer at NVidia.

External bonds

  • Blog of John Carmack
  • Study of Chris Lomont, fast calculation of the reverse of a square root

Simple: John Carmack

Random links:Socialist party (Belgium) | Youx | TV-pirate | October 27th in the railroads | Armando Reverón | KAB-500L