math: new software sqrtf
authorSzabolcs Nagy <nsz@port70.net>
Fri, 12 Jun 2020 17:34:28 +0000 (17:34 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 6 Aug 2020 03:05:36 +0000 (23:05 -0400)
commitb1756ec8848623b5ec5ca8f6705832323176e0cb
treefd2f2cc8b3511b17a9559a148d3fa17bbdd02b89
parent97e9b73d59b65d445f2ba0b6294605eac1d72ecb
math: new software sqrtf

same method as in sqrt, this was tested on all inputs against
an sqrtf instruction. (the only difference found was that x86
sqrtf does not signal the x86 specific input-denormal exception
on negative subnormal inputs while the software sqrtf does,
this is fine as it was designed for ieee754 exceptions only.)

there is known faster method:
"Computing Floating-Point Square Roots via Bivariate Polynomial Evaluation"
that computes sqrtf directly via pipelined polynomial evaluation
which allows more parallelism, but the design does not generalize
easily to higher precisions.
src/math/sqrtf.c