From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 29224 invoked from network); 26 Jan 1999 21:41:22 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 26 Jan 1999 21:41:22 -0000 Received: from paralleldata.com (smtp.paralleldata.com [38.153.145.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA32390 for ; Tue, 26 Jan 1999 16:12:56 -0500 Received: by paralleldata.com from localhost (router,SLMail V2.5); Tue, 26 Jan 1999 15:15:10 -0600 Received: by paralleldata.com from paralleldata.com (207.158.87.165::mail daemon; unverified,SLMail V2.5); Tue, 26 Jan 1999 15:15:09 -0600 Sender: "Wsb" Message-ID: <36AE3E68.B6CDB726@paralleldata.com> Date: Tue, 26 Jan 1999 22:15:04 +0000 From: "Wes Bauske" Organization: Parallel Data Systems X-Mailer: Mozilla 4.04 [en] (X11; U; Linux 2.0.33 i686) MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: An sqrt() experiment References: <199901261939.LAA05186@netcom6.netcom.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Munagala V. S. Ramanath wrote: > > Hi, > > This may be of interest to the math lib aficionados: Sun released a > freely redistributable floating point math library (full sources) > around 1996 called fdlibm. I've found it at: > ftp://ftp.imar.ro/pub/trieste/math/netlib/fdlibm > > The code is not 64-bit aware but makes very interesting reading > including the comments. In particular, the comments in e_sqrt.c > suggested what seemed like an interesting approach, so I did a > quick-and-dirty C coding job for timing purposes. It runs about 4 > times faster than the version in libm but libffm routine runs an > additional 36% faster, presumably because of the hand-tuned scheduling. > > Here are the timing results on my 533MHz 21164a (UX2 Ruffian): > > y = 30865358776.919712, time = 2.037109 secs. [sqrt] <-- libm > y = 30865358776.919712, time = 0.470703 secs. [sqt] > > y = 30865358776.919712, time = 0.303711 secs. [sqrt] <-- libffm > y = 30865358776.919712, time = 0.475586 secs. [sqt] > > Just looking at the code, it seems that a hand-tuned version of sqt() > below may do better than the libffm version, but I don't understand > the architecture of the 21164a well enough to try it. > Be careful. Your test puts as much weight on the performance of rand() as it does on sqrt(). A better source of test numbers would be to just init x to N and decrement it on each iteration. That way you're only measuring sqrt(). Wes