Avoid Dereferencing in Carmacks Implementation of Approximate Roots

Just about everyone who has even looked into maths optimisation has come across the ‘Quake III Magical Inverse Square Root Implementation’ as used by John Carmack. For those that don’t know it is a 32bit integer magic number implementation of the Newton–Raphson method for finding approximate roots.

The original code from Quake III looks like this:
[code]
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;

Posted at 12pm on 11/08/09 | no comments | Filed Under: Theory and Formulas, C++, 3D read on

Triple Boot Vista, Linux and OSX

Recently I bought a new Vaio VGN-SZ and as per usual I immediately zeroed the drive and began creating my patented partition layout. It was here that I paused for a second and thought about my recent need for an Intel Mac. A quick Google later looking at the prices for a Mac Air, and work on triple booting my Vaio was underway. The result of this work is documented below.

NOTE: I started by removing

Posted at 11pm on 05/18/08 | 5 comments | Filed Under: Linux, OSX read on