From patchwork Fri Jan 31 16:06:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 860990 Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp798861wrr; Fri, 31 Jan 2025 08:07:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWi8rmkhG49s1oM/ZZhNUmwb8jRIGUJGTMUbxwiYh/WOz7QfsqrpR96A7XM5T62jm2iqOM4AQ==@linaro.org X-Google-Smtp-Source: AGHT+IH97Gqs0KmIHhCGnoSxDoa7pPhRuVvlPWtA3R6DpIIAVTZAHO+bxp5wHvRTfsxsgkrcWWKB X-Received: by 2002:a05:6000:1788:b0:385:ef39:6ce9 with SMTP id ffacd0b85a97d-38c5194c69amr13304947f8f.21.1738339652500; Fri, 31 Jan 2025 08:07:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1738339652; cv=pass; d=google.com; s=arc-20240605; b=I51DH1j23bXPQvPtxVtSXmXfPXxQucCzdWF+JGUKB93Jy5E97ZeMH9XkYZf30tIpI/ CNfU9PlMvMTUpuXbio4XoA+/3Un5jajEugXB37+gopRsJTMsKcAsx5FalkufLqGZH6/L AXvp/DY/zAUFxO7jbOrQKwZxgF6WULxYL26zhffDYZgiUp+i833NaCAKQMA44DQukZqk NSEpvwCb1txZtRBD2gD1myl+I2g2HPALDG1wI5EHWVdmoUI72RLX++ni9SPiJFcByDOA XJf6WRM39PL57N/9UbFituAGnGIIdBsYQn2Gy660E4R+kryb8pj3VgQYHmZ1PXNI0QJ+ ScjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dkim-filter:arc-filter:dmarc-filter:delivered-to:dkim-filter; bh=TRpIzC2RGUfYGkavd0gpWQGTKIeHCFrkPfx8FaDgGCM=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=Oa5zUAmV2b4wYhWYirN87mh6wY7k48+hCtsozZKQ5QL8bytg6DPKXU5L5pBlKG1JBy hu7KVFeTSuTCh1NHTn6TYlF4QyW9xb1BR/IGWlWr8nbFVhlrdMHRykjx/ds/Sw+vglfq nAuhTHFPPZl70zvl9H7jL8d43u9tMjWCldZ64gQkiiVzPle7xnisTsqTIAGPymuhOKoC Pj1IRNiO1lerUPJY7TD1+wEzRHfM3tMEswvLxGd26aC9PQDUgS7bBg1pHZ+cS8LiFaDR C20viUT73cxQtvJ8UrrGhWy2gCB1zPpDWRD473rbgmAHf6nwwM0cqfia4bRKqec/gCIc m9wA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PqQdBWLa; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ffacd0b85a97d-38c5c20d834si2814493f8f.818.2025.01.31.08.07.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2025 08:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PqQdBWLa; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD8933858405 for ; Fri, 31 Jan 2025 16:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD8933858405 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=PqQdBWLa X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 336AE3858C48 for ; Fri, 31 Jan 2025 16:06:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 336AE3858C48 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 336AE3858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738339612; cv=none; b=GTbyFManGgGB87EsIcM012awxpiRI5Jzbq/PuqN6jXtRLN1YDd9beiNvVQgYY7vmvKchuwZe6XxSSToVbLp5YmGxgfPKdrL3zNoCFb2AdlwPyT6OuuocZGleb5miqbfbT/ksNPvojEYKz+sKUIeU8vdnJvhCFiD60RyVp4EXLQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738339612; c=relaxed/simple; bh=/ZsLAQSoFvx1s90z3rCCo41jYAmJSyk88bw1K/5IjrI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yCSD2EXWQMnDkapGHHP5DFXj32/DhbeQeO1JNwtBdovrK9einFH8NIv1KONB/5jcP+yPgxVSIcZFymXOoqCKNntfIqReIc5lWGf/AiNAswgosyeohsGd84UvThAS+oR9dND0D6iyh5C/LyxqOCjhAZwC6vVogRaMNk2YwVYZ0QU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 336AE3858C48 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21654fdd5daso38650775ad.1 for ; Fri, 31 Jan 2025 08:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738339611; x=1738944411; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=TRpIzC2RGUfYGkavd0gpWQGTKIeHCFrkPfx8FaDgGCM=; b=PqQdBWLaCNXESGlsozvDbRWBQJ9Zg92T5vrITh6wwTZZl1NkhWVArQDobuIjlvmtnq rsAWLhah4pPppNhQ0hxi9FmLZmoTH2m495wggSSzc2CaoPFFNfm+30RG1r/TU3CA//Z5 EbZQuJ02Ytwo5OWA3//ko+9BkE4dvYaN7avPYMs6+rGciY22NXZYEmSkHdpLyN9usb++ zM21GisxWlkhWmCW7W5SVhrRfw+lP1fl37nEnOE3Trs105a4AQUfbyAbIp4+rDAApaF0 y73v6yR44hNrSOfkrBnsXEL1IGTYJUV3qZqd8Y0BkbSiUKZLqZMtI7HmwFK3J2pAalIH Kxiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738339611; x=1738944411; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TRpIzC2RGUfYGkavd0gpWQGTKIeHCFrkPfx8FaDgGCM=; b=QF1g6rBWPkF7XrpCEGbWWG067bJZ4LDcltVy8HNiCW3iBLQ9ITU8BmkF70I+VQ9djV 0tfbEcpR7kxEVGuSGkUy+XOqb3jxxIvKfa6ZrNPd8iC0EBosBBWN4MaOrEB4Mj3nVvsJ B2258NdaWGvKt1HNJyDUxkyI3IZOtiXs+PrgFwxyjwsnSyGPldssawWchXo8lNGlYqUa Fyx+0oq+ZOGElPkGmNYXHQmJgZMCxUR2Y4kdC3KX+xE/UbJ8o4vNcuNlaVhdWM2c9rEL e8WAb4keURh/o/2EOM4VMi/PMLlOYd+cNVVzOH2V8XXvbaZvC0SFBf8EDoq+aK9LKFeZ viSA== X-Gm-Message-State: AOJu0YynFf5nvgj0qf5zyB+L7CA4qwZDlsPkWIdQ24GL5Dn7/9ETM8xM bjV+DGKVoEP/z6IaQv0BJRpIVj9KODoCamnWYBcdV0x3coV6jed7j84SOgPv/ii32M/KbZkDKY9 z X-Gm-Gg: ASbGncvZqDSnAs3EUou3SelF4Zo6ZsV5XLqRYltLASGx0APhDdwiivTHPObooxfG4DN a7p7ZRR9ChB5hUMyj8MYSvxaY6pWoO5YnMTrylXTn32rRft07IhgEvACJ5PYb74qSmLdZgn8Y5t gf0I6TO9KpGSGOjrfswjac55XPnjqBLZ4HDcy4cvh9Y05xiBLBhNiXJS6Qzlq69G5tu7mSdFYmQ wULpz+EBdGMuoNknHGHpr5dxxoU0k3D2eTSEK9n8KQL0D+ZH76KK3WFCkvDiaNIGxsWYZw7ZYE4 XWTFyJFAYKhoYzMT5Ql2NHWdBiKBsw== X-Received: by 2002:a05:6a20:6a0e:b0:1e2:2e4:689a with SMTP id adf61e73a8af0-1ed7a6e183bmr19015065637.41.1738339610558; Fri, 31 Jan 2025 08:06:50 -0800 (PST) Received: from ubuntu-vm.. ([177.103.113.118]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72fe69ba45asm3461033b3a.89.2025.01.31.08.06.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2025 08:06:50 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] math: Fix sinhf for some inputs (BZ 32627) Date: Fri, 31 Jan 2025 13:06:46 -0300 Message-ID: <20250131160646.1235219-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org The logic was copied wrong from CORE-MATH. --- math/auto-libm-test-in | 1 + math/auto-libm-test-out-sinh | 25 +++++++++++++++++++++++++ sysdeps/ieee754/flt-32/e_sinhf.c | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index c0627dc7eb..5f465b31f1 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -8300,6 +8300,7 @@ sinh -0x1.3dda8ap+0 sinh -0x5.ee9218p-4 sinh -0x1.bcfc98p+0 sinh -0x6.9bbb6df7c5d08p-4 +sinh 0x1.250bfep-11 # the next value generates larger error bounds on x86_64 (ldbl-96) sinh 0x2.c5d376167f4052f4p+12 sinh max diff --git a/math/auto-libm-test-out-sinh b/math/auto-libm-test-out-sinh index 0b77a77eeb..3924e19d86 100644 --- a/math/auto-libm-test-out-sinh +++ b/math/auto-libm-test-out-sinh @@ -2115,6 +2115,31 @@ sinh -0x6.9bbb6df7c5d08p-4 = sinh tonearest ibm128 -0x6.9bbb6df7c5d08p-4 : -0x6.cc3ddf003dcda77f8f9e892e36p-4 : inexact-ok = sinh towardzero ibm128 -0x6.9bbb6df7c5d08p-4 : -0x6.cc3ddf003dcda77f8f9e892e36p-4 : inexact-ok = sinh upward ibm128 -0x6.9bbb6df7c5d08p-4 : -0x6.cc3ddf003dcda77f8f9e892e36p-4 : inexact-ok +sinh 0x1.250bfep-11 += sinh downward binary32 0x2.4a17fcp-12 : 0x2.4a17fcp-12 : inexact-ok += sinh tonearest binary32 0x2.4a17fcp-12 : 0x2.4a17fcp-12 : inexact-ok += sinh towardzero binary32 0x2.4a17fcp-12 : 0x2.4a17fcp-12 : inexact-ok += sinh upward binary32 0x2.4a17fcp-12 : 0x2.4a18p-12 : inexact-ok += sinh downward binary64 0x2.4a17fcp-12 : 0x2.4a17fdffffffep-12 : inexact-ok += sinh tonearest binary64 0x2.4a17fcp-12 : 0x2.4a17fep-12 : inexact-ok += sinh towardzero binary64 0x2.4a17fcp-12 : 0x2.4a17fdffffffep-12 : inexact-ok += sinh upward binary64 0x2.4a17fcp-12 : 0x2.4a17fep-12 : inexact-ok += sinh downward intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok += sinh tonearest intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok += sinh towardzero intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok += sinh upward intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok += sinh downward m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok += sinh tonearest m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok += sinh towardzero m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok += sinh upward m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok += sinh downward binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec88p-12 : inexact-ok += sinh tonearest binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec8ap-12 : inexact-ok += sinh towardzero binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec88p-12 : inexact-ok += sinh upward binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec8ap-12 : inexact-ok += sinh downward ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ecp-12 : inexact-ok += sinh tonearest ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786edp-12 : inexact-ok += sinh towardzero ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ecp-12 : inexact-ok += sinh upward ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786edp-12 : inexact-ok sinh 0x2.c5d376167f4052f4p+12 = sinh downward binary32 0x2.c5d378p+12 : 0xf.fffffp+124 : inexact-ok overflow errno-erange-ok = sinh tonearest binary32 0x2.c5d378p+12 : plus_infty : inexact-ok overflow errno-erange diff --git a/sysdeps/ieee754/flt-32/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c index c007c7d174..dee96fc7cb 100644 --- a/sysdeps/ieee754/flt-32/e_sinhf.c +++ b/sysdeps/ieee754/flt-32/e_sinhf.c @@ -83,7 +83,7 @@ __ieee754_sinhf (float x) { /* |x| <= 0x1.250bfep-11 */ if (__glibc_unlikely (ux < 0x66000000u)) /* |x| < 0x1p-24 */ return fmaf (x, fabsf (x), x); - if (__glibc_unlikely (st.uarg == asuint (ux))) + if (__glibc_unlikely (st.uarg == ux)) { float sgn = copysignf (1.0f, x); return sgn * st.rh + sgn * st.rl;