[libc-commits] [libc] [libc][C23][math] Implement cospif function correctly rounded for all rounding modes (PR #97464)

via libc-commits libc-commits at lists.llvm.org
Mon Jul 8 00:44:53 PDT 2024


zimmermann6 wrote:

I still get errors for n+1/2 when n is negative. IEEE 754-2019 says that cos(n+1/2) is always +0, whether n is positive or negative, so that cos(-x) = cos(x) always holds.
```
Running exhaustive check in --rndn mode...
FAIL x=-0x1.7408p+12 ref=0x0p+0 y=-0x0p+0
Running exhaustive check in --rndz mode...
FAIL x=-0x1.70008p+16 ref=0x0p+0 y=-0x0p+0
Running exhaustive check in --rndu mode...
FAIL x=-0x1.7408p+12 ref=0x0p+0 y=-0x0p+0
Running exhaustive check in --rndd mode...
FAIL x=-0x1.8p+0 ref=0x0p+0 y=-0x0p+0
```

https://github.com/llvm/llvm-project/pull/97464


More information about the libc-commits mailing list