Archive

Posts Tagged ‘algorithms’

haXe and fast inverse square root

November 22, 2008 Comments off

Inverse square root is a common operation in vector normalization, something that happens a lot in 3D math, particularly in game engines.  An incredibly clever algorithm was developed using so-called ‘magic numbers’ and implemented in C, making its production debut in Quake.

Essentially, the algorithm makes a very smart guess as to an initial starting point that can be used to drive a single iteration of Newton’s method for 1/sqrt(x).  You can read more about it here,

http://betterexplained.com/articles/understanding-quakes-fast-inverse-square-root/

http://www.geometrictools.com/Documentation/FastInverseSqrt.pdf

http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
http://www.beyond3d.com/content/articles/8/

Some time ago, I gave this approach a try using ByteArray and was disappointed with the performance, although it was a fun exercise.  Recently, Nicolas Cannasse implemented the algorithm with haXe optimizations and the performance is awesome.  Great work Nicolas!

Mathematical Algorithm Predicts Political Power

October 3, 2008 Comments off

Hmmm … this sounds like an interesting application of game theory and AI, and I’d like to get a reprint of the article somewhere as I don’t subscribe to any current journals.  Even so, what I really want is an algorithm to eliminate politicians and political process.  Whether we vote for tweedledumb or tweedledumber next month, all we get is another political bozo to replace the current one.

Now, where’s the algorithm to resolve that equation imbalance?  Please forgive the rant – next post will be back on topic of text along splines :)

Categories: General, Math Tags: , ,
Follow

Get every new post delivered to your Inbox.

Join 1,291 other followers