On a Pentiuuuuum, it is often faster to do a multiply or divide than to do a table look up. This is because you can get a cache miss on the first access to a table. If the table straddles a page boundary, you can get two misses.technosaurus wrote:I took a look at some of the math functions and came up with a way to make some of the functions compile fast or small with the same code using taylor series approximation.
Way back on a Z80, when coding a game I needed sin() and cos() very inaccurately. I observed that the first half cycle of sin() looks a lot like the shape of X(1-X) from 0 to 1 to work well enough to look reasonable.