Just about a year ago, someone identified just as "ryszard" wrote about five tight lines of C code that calculate an approximate inverse square root (1/sqrt(x)). Mark Rickerby pointed the article out to me.

Like many chapters of Beautiful Code, this article challenges some assumptions about good coding that the software engineering literature has repeated to us over the years--notably, assumptions about hardware independence that's important for portability and thus for long-term correctness. Luckily, because neither integer nor floating-point formats are likely to change in the forseeable future, this Quake code looks risk-free. Still, ryszard seems conscious that it occupies one of the lower rungs of beauty, calling it a "really cool hack."

The code is described as being useful for 'normalisation of 3D vectors," which I am guessing can be useful for comparing trajectories in games, whether of the sun's rays or your bullets.

ryszard's search for authorship was also pretty damned impressive. While he laments at the end that he can't quite find out who put those five lines in its final form, he does succeed in finding the computer science professor who probably created the algorithm, identifying the MIT department known for that style of coding, and finding one of the Quake team who worked on that particular function.