This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
> > float sqrt(float r) { > float q = rsqrt(r); // approx. 1.0 / sqrt (r); > float y = q * r; // approx sqrt (r) > float e = y * y - r; // y == sqrt (r + e), with e small > return y - e / (2.0 * y); // Newton Raphson correction > }
That itself has a division in it, and hence wouldn't be better than just using the normal sqrt (no recriprocal) instruction.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |