Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP32 coshf_u10 and FP64 cosh_u10 are inaccurate #460

Open
hdelassus opened this issue Apr 7, 2023 · 0 comments
Open

FP32 coshf_u10 and FP64 cosh_u10 are inaccurate #460

hdelassus opened this issue Apr 7, 2023 · 0 comments
Labels

Comments

@hdelassus
Copy link

hdelassus commented Apr 7, 2023

On x64 targets, we found that Sleef_coshf_u10 and Sleef_cosh_u10 have maximum absolute error > 1 ulp.

The entry points for which the errors were reproduced are:

  • Sleef_cosh_u10
  • Sleef_coshd1_u10
  • Sleef_coshd1_u10purec
  • Sleef_coshd1_u10purecfma
  • Sleef_coshd2_u10
  • Sleef_coshd2_u10avx2128
  • Sleef_coshd2_u10sse2
  • Sleef_coshd2_u10sse4
  • Sleef_coshd4_u10avx2
  • Sleef_coshd8_u10avx512f
  • Sleef_coshf_u10
  • Sleef_coshf1_u10
  • Sleef_coshf1_u10purec
  • Sleef_coshf1_u10purecfma
  • Sleef_coshf4_u10
  • Sleef_coshf4_u10avx2128
  • Sleef_coshf4_u10sse2
  • Sleef_coshf4_u10sse4
  • Sleef_coshf8_u10avx2
  • Sleef_coshf16_u10avx512f

Reproducers are attached. Compile them with:

cc -O3 coshf-test.c -o coshf-test -mavx512f -lm -lsleef -lmpfr
cc -O3 cosh-test.c -o cosh-test -mavx512f -lm -lsleef -lmpfr

Outputs:

$ ./test-coshf
coshf_0(-0x1.634ceep+6) = inf
coshf_1(-0x1.634ceep+6) = inf
coshf_2(-0x1.634ceep+6) = inf
coshf_3(-0x1.634ceep+6) = inf
coshf_4(-0x1.634ceep+6) = inf
coshf_5(-0x1.634ceep+6) = inf
coshf_6(-0x1.634ceep+6) = inf
coshf_7(-0x1.634ceep+6) = inf
coshf_8(-0x1.634ceep+6) = inf
coshf_9(-0x1.634ceep+6) = inf
MPFR faithful results = 0x1.1b925ap+127, 0x1.1b925cp+127
$ ./test-cosh
cosh_0(0x1.62f58b40d30edp+9) = inf
cosh_1(0x1.62f58b40d30edp+9) = inf
cosh_2(0x1.62f58b40d30edp+9) = inf
cosh_3(0x1.62f58b40d30edp+9) = inf
cosh_4(0x1.62f58b40d30edp+9) = inf
cosh_5(0x1.62f58b40d30edp+9) = inf
cosh_6(0x1.62f58b40d30edp+9) = inf
cosh_7(0x1.62f58b40d30edp+9) = inf
cosh_8(0x1.62f58b40d30edp+9) = inf
cosh_9(0x1.62f58b40d30edp+9) = inf
MPFR faithful results = 0x1.252d53b6b0c93p+1023, 0x1.252d53b6b0c94p+1023

These results unduly overflow.

@blapie blapie added the algo label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants