difference between pow and fastpow

lucas's icon

does anybody know the maths behind fastpow ? is there any situations where pow is really necessary to use? i'm curious why the difference in efficiency is so big.

Roman Thilenius's icon

i don´t even know the object. but there are at least one, if not two, really effective abbreviations für pow() and sqrt which use less calculations - instead of calculating all integers fastpow only uses 21, 22, 23... and 1 and the maximum.

as far as i understand it, all of these methods are iterative processes, so that you can just stop after half of the calcualtions if you reached the desired precision (like for geometry in computergames and similar applications, where you round to integer - or an even greater a grid - anyway.)