In article <4794bdad$0$23838$>,
lid says...
[ ... ]
> For example in intel architectures pow() is rather slow because
> there's no such FPU opcode in 387. We are probably talking about many
> hundreds, if not even over a thousand clock cycles even on a Pentium.
> While compilers may try to optimize the pow() call away if they can,
> they often can't.
I don't know of any processor that would let you implement pow in a
single instruction -- but Intel floating point includes instructions for
logarithm and inverse logarithm, which make pow pretty easy to
implement.
As far as speed goes, you should be looking at about 150-190 CPU cycles
on a reasonably modern CPU (depending somewhat on data). I haven't found
any data for which it takes 200 cycles on my machine, and it's a few
years old -- I believe current CPUs are typically at least 20-30% faster
at the same clock speed.
--
Later,
Jerry.
The universe is a figment of its own imagination.