From owner-cvs-src-old@FreeBSD.ORG Sun Dec 5 22:11:24 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AD2A106582A for ; Sun, 5 Dec 2010 22:11:24 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 681BD8FC1E for ; Sun, 5 Dec 2010 22:11:24 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id oB5MBOfo052883 for ; Sun, 5 Dec 2010 22:11:24 GMT (envelope-from das@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id oB5MBOHu052882 for cvs-src-old@freebsd.org; Sun, 5 Dec 2010 22:11:24 GMT (envelope-from das@repoman.freebsd.org) Message-Id: <201012052211.oB5MBOHu052882@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to das@repoman.freebsd.org using -f From: David Schultz Date: Sun, 5 Dec 2010 22:11:03 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/msun/src k_log.h k_logf.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:11:24 -0000 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)