sine and cosine

BlitzMax Forums/BlitzMax Beginners Area/sine and cosine

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It's not a matter of how many millisecs difference there are, it's a matter of how much of an improvement is achieved by using memory access over FPU instructions. All other things equal, my example illustrates that using look-up tables is only actually a marginal improvement rather than 3 times as fast.

Your example uses the same index all the time, thus allowing on-die registers to be re-used for all look-ups (so it only accesses memory once), rather than reading from memory every time. This means that the Cos/Sin verion is doing 8 times the work, and thus is (possibly unintentionally) designed to give the impression that memory access is faster than FPU instructions.

My example is still far from a flawless benchmark, it's purpose is simply to illustrate the flaws inherent in yours.

which does not prove much to me.
You're entitled to write your program in whatever fashion you think is best. You asked a question, and I responded - believe what you will. If you cannot see how a 3x increase in speed is different from a 1.2x increase in speed, there is not likey anything I can do to convince you otherwise.