Date: Sun, 5 Dec 2010 22:11:03 +0000 (UTC) From: David Schultz <das@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/lib/msun/src k_log.h k_logf.h Message-ID: <201012052211.oB5MBOHu052882@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
das 2010-12-05 22:11:03 UTC
FreeBSD src repository
Added files:
lib/msun/src k_log.h k_logf.h
Log:
SVN rev 216210 on 2010-12-05 22:11:03Z by das
Add a "kernel" log function, based on e_log.c, which is useful for
implementing accurate logarithms in different bases. This is based
on an approach bde coded up years ago.
This function should always be inlined; it will be used in only a few
places, and rudimentary tests show a 40% performance improvement in
implementations of log2() and log10() on amd64.
The kernel takes a reduced argument x and returns the same polynomial
approximation as e_log.c, but omitting the low-order term. The low-order
term is much larger than the rest of the approximation, so the caller of
the kernel function can scale it to the appropriate base in extra precision
and obtain a much more accurate answer than by using log(x)/log(b).
Revision Changes Path
1.1 +116 -0 src/lib/msun/src/k_log.h (new)
1.1 +55 -0 src/lib/msun/src/k_logf.h (new)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012052211.oB5MBOHu052882>
