4 ms·
I first saw the code in the early 2000's and although I figured out the newton-rapshon part I couldn't wrap my head around the magic number, until I read chris
by lvoudour 9y ago
I first saw the code in the early 2000's and although I figured out the newton-rapshon part I couldn't wrap my head around the magic number, until I read chris Lomont's famous paper[1]. A little gem which reminds us that not that long ago computing resources were a limited commodity.
Abundance is great and speeds up development time, but unfortunately it leads to laziness and bloat
[1] http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
- gilbetron 9y agoOh man, lets hope Chris doesn't read this - he doesn't need an even bigger ego! (he's a personal friend and a great guy!)
- lvoudour 9y agoThen don't tell him I've also read all his floating point papers as well back in the day :)
- Sinergy2 9y ago>> not that long ago computing resources were a limited commodity. They are still limited in non-phone embedded contexts these days, leading to the ironic situation that the radar in your car that can override your brakes is running a much weaker CPU than your phone. RAM measured in the low megabytes. Source: I write code for one of those radars and this constant appears in that code, alongside several other sqrt implementations of varying resolutions (8b, 16b, float). You are expected to use the least-resolution option in your algorithm, based on your analysis/testing. Same goes for trig functions. I have to keep computer game development textbooks from the nineties and aughts around for reference material.