From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id B5083385783D for ; Wed, 13 Jan 2021 07:52:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B5083385783D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Paul.Zimmermann@inria.fr X-IronPort-AV: E=Sophos;i="5.79,343,1602540000"; d="scan'208";a="486795092" Received: from tomate.loria.fr (HELO tomate) ([152.81.10.51]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 08:52:39 +0100 Date: Wed, 13 Jan 2021 08:52:39 +0100 Message-Id: From: Paul Zimmermann To: Keith Packard Cc: newlib@sourceware.org In-Reply-To: <87mtxdmjdd.fsf@keithp.com> (message from Keith Packard on Tue, 12 Jan 2021 22:38:38 -0800) Subject: Re: issue with tgammaf References: <87een3eyq4.fsf@keithp.com> <87sgbheouh.fsf@keithp.com> <878sd8e62g.fsf@keithp.com> <87mtxdmjdd.fsf@keithp.com> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 07:52:42 -0000 Dear Keith, > Are you able to share the code which performs these tests? I'd love to > be able to run these on a regular basis to ensure that no regressions > occur as we maintain the code. I will send you privately the code, since it is not yet ready for a wide distribution. > > tgamma: > > Total: errors=2028164922 (47.41%) errors2=1833526367 maxerr=2.39e+02 ulp(s) > > Total: errors=2026865970 (47.38%) errors2=1832940352 maxerr=2.39e+02 ulp(s) > > Given that around half of the possible input values (> 35, or near > negative integers) generate an overflow, it seems like tgamma > essentially *never* gives us an accurate finite result... on a sample of 1/1000 of all values, it appears most errors come from exponents (ilogbf) between -64 and -7. For example with exponent -64 I get no incorrect rounding with glibc-2.32 out of 16776 samples, but 16410 with newlib. For example for x=0x1.00e8p-64 newlib gives 0x1.fe31d6p+63 whereas the correct rounding is 0x1.fe31a4p+63 according to MPFR. Best regards, Paul