From owner-cvs-src@FreeBSD.ORG Wed Oct 26 12:36:19 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AABC16A41F; Wed, 26 Oct 2005 12:36:19 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD06643D46; Wed, 26 Oct 2005 12:36:18 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9QCaI0h041602; Wed, 26 Oct 2005 12:36:18 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9QCaI5s041601; Wed, 26 Oct 2005 12:36:18 GMT (envelope-from bde) Message-Id: <200510261236.j9QCaI5s041601@repoman.freebsd.org> From: Bruce Evans Date: Wed, 26 Oct 2005 12:36:18 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/msun/src k_cos.c k_cosf.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2005 12:36:19 -0000 bde 2005-10-26 12:36:18 UTC FreeBSD src repository Modified files: lib/msun/src k_cos.c k_cosf.c Log: Use a better algorithm for reducing the error in __kernel_cos[f](). This supersedes the fix for the old algorithm in rev.1.8 of k_cosf.c. I want this change mainly because it is an optimization. It helps make software cos[f](x) and sin[f](x) faster than the i387 hardware versions for small x. It is also a simplification, and reduces the maximum relative error for cosf() and sinf() on machines like amd64 from about 0.87 ulps to about 0.80 ulps. It was validated for cosf() and sinf() by exhaustive testing. Exhaustive testing is not possible for cos() and sin(), but ucbtest reports a similar reduction for the worst case found by non-exhaustive testing. ucbtest's non-exhaustive testing seems to be good enough to find problems in algorithms but not maximum relative errors when there are spikes. E.g., short runs of it find only 3 ulp error where the i387 hardware cos() has an error of about 2**40 ulps near pi/2. Revision Changes Path 1.10 +17 -24 src/lib/msun/src/k_cos.c 1.10 +5 -27 src/lib/msun/src/k_cosf.c