ACC wrote...
....
We have a SQRT function, but I don't see anything boynd that.
Tangential!
SQRT is a hold-over from the bad old days when floating point math was
done is software rather than in dedicated hardware. Prior to 1990 or so
most computers didn't have floating point units/numeric data
processors/math coprocessors, so math libraries included detailed
functions to calculate logarithms and antilogarithms in order to
calculate arbitrary powers. SQRT was so frequently used in physical and
statistical algorithms that it was expedient to make it a separate
function using an algorithm specific to square roots, and therefore
much more efficient in software than the general approach.
These days when almost all computers have IEEE hardware floating point
units, there's nothing gained by having the SQRT function because
SQRT(x) and x^0.5 will make the same call to the FPU and receive the
same result from it. In fact, the SQRT call would require setting up a
call stack unless the compiler were optimized to convert SQRT(x) into
inline ((x)^0.5).