0

I have to raise a number to the power of 1/2.2 which is 0.45454545... many times. Actually I have to do this in a loop. Simple pow/powf is very slow (when I comment out this pow from my loop code it's a loot faster). Is there any way to optimize such operation?

Michał Z.
  • 4,119
  • 1
  • 22
  • 32
  • The answer depends on the value range of your argument numbers. If you only have a limited number of different arguments, a lookup table might be feasible. – Axel Kemper Nov 09 '13 at 23:46

1 Answers1

1

You might give a look at: Optimized Approximative pow() in C / C++

It also includes a benchmark.

Jean Logeart
  • 52,687
  • 11
  • 83
  • 118