Pow

Pow is a function that exists in various programming languages that usually takes two numbers as input and returns the first number to the power of the second number

Sqrt

The `sqrt` function returns the positive square root of a number in several programming languages.



Fast implementation accurate

Example

"My question is is fast implementation of pow x 0.5f faster than fast sqrt x"

from question  

Is fast implementation of pow(x, 0.5f) faster than fast sqrt(x)?

"First of all sqrt x should be faster and more accurate than pow x 0.5 why do you think it s in the library"

from question  

Different results on using sqrt() and pow() functions

Others

Example

It works even better when the power is higher but might not be good with powers smaller than 1 indeed pow is a really slow function even slower than sqrt which make sense since any sqrt operation could be done with pow using a fraction as exponent there is no way to compute the power exactly more efficiently but there are pretty good way to estimate it

from question  

Fast image gamma correction

And as tom karzes mentioned sqrt is also better than using pow for calculating square roots

from question  

Programming in C, Using pow function

Sqrt on the other hand is guaranteed to be correctly rounded by the ieee specification and that s why your code works with sqrt and not with pow;pow is very difficult to implement correctly --- that is so that things like returns x for those x where that s the right answer

from question  

Different results on using sqrt() and pow() functions

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0