^2 speed question

Blitz3D Forums/Blitz3D Programming/^2 speed question

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.

If you feel comfortable, you could step into the weird and wonderful world of logarithms...

if x= a^1.5

then log x = 1.5 * log a

This could be handy if you have to calculate a lot of different powers of 'a' as you can get the log once and then use this value in a whole series of simple multiplications. You would then use exp(x) to 'translate' them back into normal numbers.

To be honest, your ALU/FPU is probably going to handle this realtime better than most hand-coded optimisations (I guess!)