From: Sunil Pandey <skpgkp2@gmail.com>
To: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] math: Add more input to atanh accuracy tests
Date: Thu, 24 Feb 2022 07:57:03 -0800 [thread overview]
Message-ID: <CAMAf5_cG5uS+VsP0-BSv_FEmyy+RN3xctm7Z=HBu+wO8dsnmAQ@mail.gmail.com> (raw)
In-Reply-To: <mw7d9ka9lx.fsf@tomate.loria.fr>
On Thu, Feb 24, 2022 at 1:37 AM Paul Zimmermann
<Paul.Zimmermann@inria.fr> 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 <goldstein.w.n@gmail.com>
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 <libc-alpha@sourceware.org>
> >
> > 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
> >
next prev parent reply other threads:[~2022-02-24 15:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 2:57 [PATCH] " Sunil K Pandey
2022-02-16 7:43 ` Paul Zimmermann
2022-02-16 18:40 ` Sunil Pandey
2022-02-19 4:01 ` Paul Zimmermann
2022-02-24 0:04 ` [PATCH v2] " Sunil K Pandey
2022-02-24 9:37 ` Paul Zimmermann
2022-02-24 15:57 ` Sunil Pandey [this message]
2022-02-24 16:13 ` Paul Zimmermann
2022-02-24 16:31 ` Sunil Pandey
2022-02-24 16:38 ` Paul Zimmermann
2022-02-24 3:32 ` [PATCH] " Sunil Pandey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMAf5_cG5uS+VsP0-BSv_FEmyy+RN3xctm7Z=HBu+wO8dsnmAQ@mail.gmail.com' \
--to=skpgkp2@gmail.com \
--cc=Paul.Zimmermann@inria.fr \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).