From owner-cvs-src@FreeBSD.ORG Wed Jul 5 22:59:33 2006 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 D686E16A4DD; Wed, 5 Jul 2006 22:59:33 +0000 (UTC) (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 A337E43D49; Wed, 5 Jul 2006 22:59:33 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k65MxXUS079653; Wed, 5 Jul 2006 22:59:33 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k65MxXnm079652; Wed, 5 Jul 2006 22:59:33 GMT (envelope-from bde) Message-Id: <200607052259.k65MxXnm079652@repoman.freebsd.org> From: Bruce Evans Date: Wed, 5 Jul 2006 22:59:33 +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 s_tanh.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, 05 Jul 2006 22:59:33 -0000 bde 2006-07-05 22:59:33 UTC FreeBSD src repository Modified files: lib/msun/src s_tanh.c Log: Fixed tanh(-0.0) on ia64 and optimizeed tanh(x) for 2**-55 <= |x| < 2**-28 as a side effect, by merging with the float precision version of tanh() and the double precision version of sinh(). For tiny x, tanh(x) ~= x, and we used the expression x*(one+x) to return this value (x) and set the inexact flag iff x != 0. This doesn't work on ia64 since gcc -O does the dubious optimization x*(one+x) = x+x*x so as to use fma, so the sign of -0.0 was lost. Instead, handle tiny x in the same as sinh(), although this is imperfect: - return x directly and set the inexact flag in a less efficient way. - increased the threshold for non-tinyness from 2**-55 to 2**-28 so that many more cases are optimized than are pessimized. Updated some comments and fixed bugs in others (ranges for half-open intervals mostly had the open end backwards, and there were nearby style bugs). Revision Changes Path 1.8 +10 -10 src/lib/msun/src/s_tanh.c