https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105246

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Andrew Stubbs from comment #2)
>   Square root. Precision is (2**29) ULP, and supports denormals.
> 
> The compiler already emits Newton Raphson iterations for division with
> -ffast-math, so I'm sure it can be done, but I'm not too clear on the
> mathematics myself.

See for instance https://math.mit.edu/~stevenj/18.335/newton-sqrt.pdf
Namely for x = sqrt(a)

  x_(n+1) = ½ (x_n + a / x_n)

This has quadratic convergence.

Reply via email to