From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id D7A5E3858402 for ; Thu, 24 Feb 2022 15:57:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D7A5E3858402 Received: by mail-qv1-xf32.google.com with SMTP id j5so4235072qvs.13 for ; Thu, 24 Feb 2022 07:57:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jYW4JRJYOK1eIJjYGcdDdPFTLDIRhAJU0tjLfWvkclk=; b=vuVaq4SHpiy7HoBZ+qNAvA62mZHDY7zBNlq4A8BixEziT9hojqyvZiYkyUJnQ9OxxR RedK6YikEgac+bwQirIkm5FxH8kUyu9BVBLW0eykawLbyff9Y4afVtRrtawZ42DR8Jrr EceG9Oilrv5HQ/IPmELIEOYViOr1jXDd983yS9awcHh6+VPCdmWg77/xchL+W5cceFKL nQP5e2V59yOOB2HsrjhvzbYeWTXiQ6t/ttoyb4cpdKq+Rn7A4ZotEqxIM1uMKw026Nem vTddCad74B12HQQ/8UZXnpSuUdBSzVPlesCNRvD4mq/RrYwqtREU+RxpthvcdVPytUP2 Qpkg== X-Gm-Message-State: AOAM532CVs/WdaZ6kJIH7RETciG1M4VZ6sqPDa73HDR71opZCGY39hQt BGePbF6UEk1uPspvIc2rNGakTGKJxGjoaRwX/qJUoXfpU1I= X-Google-Smtp-Source: ABdhPJzoOQWNo50wlAm5OUvuCFBriiDOLyH7TOKZ6J6DyYbIx17KKKigjm13VPveDrgN5s9Oz/6uVvfoYZkYMiT9NlY= X-Received: by 2002:a05:6214:23cb:b0:430:918f:4623 with SMTP id hr11-20020a05621423cb00b00430918f4623mr2438921qvb.26.1645718259347; Thu, 24 Feb 2022 07:57:39 -0800 (PST) MIME-Version: 1.0 References: <20220224000423.13804-1-skpgkp2@gmail.com> In-Reply-To: From: Sunil Pandey Date: Thu, 24 Feb 2022 07:57:03 -0800 Message-ID: Subject: Re: [PATCH v2] math: Add more input to atanh accuracy tests To: Paul Zimmermann Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-List-Received-Date: Thu, 24 Feb 2022 15:57:41 -0000 On Thu, Feb 24, 2022 at 1:37 AM Paul Zimmermann wrote: > > Dear Sunil, > > I cannot reproduce the error of 2.4 ulps with 0x1.f80094p-8, the maximal > error I get is 1.45 ulps (with master revision b98d0bb): > Hi Paul, Please try this one line patch on glibc master. In our testing, before this patch accuracy for input 0x1.f80094p-8 was ~1.4, after this patch accuracy for input 0x1.f80094p-8 jumps to 2.4 and it fails. None of the existing inputs catch this accuracy error jump. commit c55a882ac9fbe9241cd0537affdbdb35a7a4b6e4 (HEAD -> users/goldsteinn/atanhf-testable, origin/users/goldsteinn/atanhf-testable) Author: Noah Goldstein Date: Mon Jan 31 23:00:28 2022 -0600 Does this have any bugs diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_atanhf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_atanhf16_core_avx512.S index f863f4f959..064424b977 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_atanhf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_atanhf16_core_avx512.S @@ -148,7 +148,7 @@ ENTRY(_ZGVeN16v_atanhf_skx) vfmadd213ps {rn-sae}, %zmm5, %zmm3, %zmm1 vmovups poly_coeff2+__svml_satanh_data_internal_avx512(%rip), %zmm3 vmovaps %zmm3, %zmm2 - vfmadd231ps {rn-sae}, %zmm9, %zmm7, %zmm2 +// vfmadd231ps {rn-sae}, %zmm9, %zmm7, %zmm2 vfmadd231ps {rn-sae}, %zmm4, %zmm7, %zmm3 vfmadd213ps {rn-sae}, %zmm12, %zmm9, %zmm2 vfmadd213ps {rn-sae}, %zmm12, %zmm4, %zmm3 Thanks, Sunil > pzimmermann@grvingt-63:~/svn/tbd/20/src/binary32_exhaustive$ LIBMVEC=512 GLIBC=glibc ./doit.libmvec atanh > LIBMVEC=512 -mavx512f > 00000000004148f0 T mpfr_atanh > 0000000000401668 t mpfr_atanh.cold > U _ZGVeN16v_atanhf@GLIBC_2.35 > Checking atanh with libmvec from glibc and rndn > Thu 24 Feb 2022 10:28:21 AM CET > MPFR library: 4.1.0 > MPFR header: 4.1.0 (based on 4.1.0) > Checking function atanhf with MPFR_RNDN > libm wrong by up to 1.45e+00 ulp(s) [1] for x=0x1.f2100ap-9 > atanh gives 0x1.f210aap-9 > mpfr_atanh gives 0x1.f210a8p-9 > Total: errors=58600734 (1.37%) errors2=0 maxerr=1.45e+00 ulp(s) > > Best regards, > Paul > > > Date: Wed, 23 Feb 2022 16:04:23 -0800 > > From: Sunil K Pandey via Libc-alpha > > > > This patch adds following input to atanh accuracy test. > > > > 0x1.f80094p-8 > > > > Tested on x86-64 and i686 platforms. > > Other platforms may have to regenerate ulps file. > > --- > > math/auto-libm-test-in | 3 +++ > > math/auto-libm-test-out-atanh | 25 +++++++++++++++++++++++++ > > 2 files changed, 28 insertions(+) > > > > diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in > > index 9080afe4fb..30fbada31f 100644 > > --- a/math/auto-libm-test-in > > +++ b/math/auto-libm-test-in > > @@ -617,6 +617,9 @@ atanh -0x3.98eaf4p-4 > > atanh 0x2.c1085p-4 > > atanh 0x1p-500 > > atanh 0x1p-5000 > > +# the next value generates larger error bounds in libmvec/avx512 on x86_64 > > +# (binary32) > > +atanh 0x1.f80094p-8 > > # the next value generates larger error bounds on x86_64 (binary128) > > atanh 0x2.c02a24f3472c7840afbd8cfb68bap-4 > > atanh min > > diff --git a/math/auto-libm-test-out-atanh b/math/auto-libm-test-out-atanh > > index 378ef6e8cf..a5243264be 100644 > > --- a/math/auto-libm-test-out-atanh > > +++ b/math/auto-libm-test-out-atanh > > @@ -3112,6 +3112,31 @@ atanh 0x1p-5000 > > = atanh tonearest binary128 0x1p-5000 : 0x1p-5000 : inexact-ok > > = atanh towardzero binary128 0x1p-5000 : 0x1p-5000 : inexact-ok > > = atanh upward binary128 0x1p-5000 : 0x1.0000000000000000000000000001p-5000 : inexact-ok > > +atanh 0x1.f80094p-8 > > += atanh downward binary32 0x1.f80094p-8 : 0x1.f8031ep-8 : inexact-ok > > += atanh tonearest binary32 0x1.f80094p-8 : 0x1.f8032p-8 : inexact-ok > > += atanh towardzero binary32 0x1.f80094p-8 : 0x1.f8031ep-8 : inexact-ok > > += atanh upward binary32 0x1.f80094p-8 : 0x1.f8032p-8 : inexact-ok > > += atanh downward binary64 0x1.f80094p-8 : 0x1.f8031f3228153p-8 : inexact-ok > > += atanh tonearest binary64 0x1.f80094p-8 : 0x1.f8031f3228154p-8 : inexact-ok > > += atanh towardzero binary64 0x1.f80094p-8 : 0x1.f8031f3228153p-8 : inexact-ok > > += atanh upward binary64 0x1.f80094p-8 : 0x1.f8031f3228154p-8 : inexact-ok > > += atanh downward intel96 0x1.f80094p-8 : 0x1.f8031f3228153f0ep-8 : inexact-ok > > += atanh tonearest intel96 0x1.f80094p-8 : 0x1.f8031f3228153f0ep-8 : inexact-ok > > += atanh towardzero intel96 0x1.f80094p-8 : 0x1.f8031f3228153f0ep-8 : inexact-ok > > += atanh upward intel96 0x1.f80094p-8 : 0x1.f8031f3228153f1p-8 : inexact-ok > > += atanh downward m68k96 0x1.f80094p-8 : 0x1.f8031f3228153f0ep-8 : inexact-ok > > += atanh tonearest m68k96 0x1.f80094p-8 : 0x1.f8031f3228153f0ep-8 : inexact-ok > > += atanh towardzero m68k96 0x1.f80094p-8 : 0x1.f8031f3228153f0ep-8 : inexact-ok > > += atanh upward m68k96 0x1.f80094p-8 : 0x1.f8031f3228153f1p-8 : inexact-ok > > += atanh downward binary128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d2afp-8 : inexact-ok > > += atanh tonearest binary128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d2bp-8 : inexact-ok > > += atanh towardzero binary128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d2afp-8 : inexact-ok > > += atanh upward binary128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d2bp-8 : inexact-ok > > += atanh downward ibm128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d28p-8 : inexact-ok > > += atanh tonearest ibm128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d28p-8 : inexact-ok > > += atanh towardzero ibm128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d28p-8 : inexact-ok > > += atanh upward ibm128 0x1.f80094p-8 : 0x1.f8031f3228153f0e56e4db72d3p-8 : inexact-ok > > atanh 0x2.c02a24f3472c7840afbd8cfb68bap-4 > > = atanh downward binary32 0x2.c02a28p-4 : 0x2.c73a3cp-4 : inexact-ok > > = atanh tonearest binary32 0x2.c02a28p-4 : 0x2.c73a3cp-4 : inexact-ok > > -- > > 2.34.1 > >