News for hackers. Stuff that matters.
Re:TinyVM: A lightweight, fast virtual machine in < 500 l... by Retric on Sunday July 03, 2011 @12:16AM (#2723062)
No, at best you could do a binary search using if's to simulate a lookup table, but you are going to trash the pipeline on a modern CPU if you want a reasonably complex lookup table you are much better off with something like:

float lookup_Sine(x){ int I = 100 * (x mod 360); return sine_table(I); }

Anyway, for a modern CPU hitting main memory takes a lot of cycles. So you need something a lot more complex than a simple trig function to make it worth it.

There are no comments on this comment yet.