From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <36DEE449.79A9A469@frankfurt.netsurf.de> Date: Thu, 04 Mar 1999 20:51:37 +0100 From: Joachim Wesner Subject: Re: sqrt performance, further comment. In-Reply-To: <199903041941.MAA20283@ellpspace.math.ualberta.ca> Michal Jaegermann wrote: > > > I would have to revisit my old files; this was quite a while ago. > Maybe this was a rational approximation (it should not not be too costly > on Alpha) but I had in the past pretty decent approximation for a sqrt on > [0,2) interval. I do not remember max absolute errors, though. > Details are fuzzy now. You may be right that with one Newton iteration > one will be still not precise enough in the whole required range. > > [0,2) was used as this allowed not to worry about even and odd > exponents. > > Michal Yes, you are right, rational is known to be MUCH better, but you need pretty SLOW div !! I checked several combinations (with div) considering full range, full *REL* precision and decided it would very likely be slower than the Mosberger sqrt. However, what I suggest for 1e-10 precision (including 1 Newton step) might probably work (mean, be a bit faster, but compared to libcpml ???) And yes we probably could replace the rather small table in the libffm sqrt by another (nonrational) polynomial, but for .25 to 1 we need at least 8th to better 9th order for 1e-5 (here my software is pretty dependable) to be on the sure side after 3 Newton steps, and it will be DEFINITELY slower than the actual version. You see, sqrt is "§$%&/@ as long as you don't go for rational approx. YES, in case cache misses occur, this would be different, but I'm still waiting for the results what the real-world impact on that seems to be. Greetings   Joachim