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]

Re: [PATCH] Constant fold sqrt at compile time (take 3)


On 03-Nov-2002, Roger Sayle <roger@eyesopen.com> wrote:
> 
> The third and final change is to implement Karp and Markstein's
> final iteration method.  The Newtonian iteration produces the
> approximation 1/sqrt(x), and previously we'd get our final result
> by just multiplying this value by the original argument x.  The
> "Karp and Markstein" approach is to use a slightly modified final
> iteration to produce sqrt(x).  Due to the self-correcting nature
> of Newton-Raphson, this results in an answer accurate to 1 ulps.
> 
> For more details see equation (5) of "High Precision Division
> and Square Root", Alan H. Karp and Peter Markstein, HP Lab Report
> 93-93-42, June 1993.
> http://www.hpl.hp.com/techreports/93/HPL-93-42.pdf

It would be nice to include that reference in a comment in the source, IMHO.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]