From patchwork Mon Aug 3 13:19:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Zimmermann X-Patchwork-Id: 40200 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54DED385703F; Mon, 3 Aug 2020 13:19:29 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 ABCBF3858D35 for ; Mon, 3 Aug 2020 13:19:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABCBF3858D35 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.75,430,1589234400"; d="scan'208";a="462285232" 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; 03 Aug 2020 15:19:25 +0200 Date: Mon, 03 Aug 2020 15:19:25 +0200 Message-Id: From: Paul Zimmermann To: Florian Weimer In-reply-to: <87lfj1jse3.fsf@oldenburg2.str.redhat.com> (message from Florian Weimer on Thu, 30 Jul 2020 10:53:24 +0200) Subject: fix inaccuracy of j0f for x >= 2^127 when sin(x)+cos(x) is tiny (v4) References: <87wo2oxahr.fsf@igel.home> <87lfj1jse3.fsf@oldenburg2.str.redhat.com> X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H4, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Dear Florian, > I suggest to leave it at 6, other CPU variants may still need the 6 > there. here is a new version. Paul From 971c832c2087e9463951d1b07b48d4d9a998e8c0 Mon Sep 17 00:00:00 2001 From: Paul Zimmermann Date: Mon, 3 Aug 2020 15:16:39 +0200 Subject: [PATCH] fix inaccuracy of j0f for x >= 2^127 when sin(x)+cos(x) is tiny (v4) --- math/auto-libm-test-in | 2 ++ sysdeps/ieee754/flt-32/e_j0f.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index 4414e54d93..5d488a8711 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -5748,6 +5748,8 @@ j0 0x1p16382 j0 0x1p16383 # the next value generates larger error bounds on x86_64 (binary32) j0 0x2.602774p+0 xfail-rounding:ibm128-libgcc +# the next value exercises the flt-32 code path for x >= 2^127 +j0 0x8.2f4ecp+124 j1 -1.0 j1 0.0 diff --git a/sysdeps/ieee754/flt-32/e_j0f.c b/sysdeps/ieee754/flt-32/e_j0f.c index c89b9f2688..91e8de8fe3 100644 --- a/sysdeps/ieee754/flt-32/e_j0f.c +++ b/sysdeps/ieee754/flt-32/e_j0f.c @@ -55,7 +55,22 @@ __ieee754_j0f(float x) z = -__cosf(x+x); if ((s*c)