Re: An sqrt() experiment


Joachim Wesner (Joachim.Wesner@frankfurt.netsurf.de)
Tue, 26 Jan 1999 22:20:58 +0100


On Tue, 26 Jan 1999, 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.
>

This is a bit confusing. Already for some time, the "official" libm on
AXP/Linux **IS** based on fdlibdm !!

Especially, the very old sqrt, was that single-bit-a-time version from libfdm,
later it was replaced by an assembler version of the method you cite. libffm
slightly improves on that. It seems strange, that you get near those figures
with your C version. It seems likely that your timing is governed by other
factors, but not (really) sqrt.

From your code, I get about 303 ns/sqrt. However, the raw libffm speed of sqrt
is about 120 ns !!

Joachim Wesner

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com



This archive was generated by hypermail 2.0b3 on Tue Jan 26 1999 - 14:00:25 PST