[libc-commits] [libc] [llvm] [libc][math][c23] Add atan2f16 function (PR #183531)
Xinlong Chen via libc-commits
libc-commits at lists.llvm.org
Fri Feb 27 06:37:39 PST 2026
Xinlong-Chen wrote:
> With atan2f16, we can test exhaustively all inputs (~2^31). Can you add an exhaustive test for it in `libc/test/src/math/exhaustive` folder. Notice that it will need to be run manually after built with ninja.
Thanks for the review. I've made the requested changes - please let me know if anything else looks off.
I have implement an exhaustive test for `atan2f16` (in libc/test/src/math/exhaustive/atan2f16_test.cpp) by comparing its output to MPFR over the float16 input range.
The results are as follows (manually run, taking nearly 3h):
```
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcAtan2f16ExhaustiveTest.AllInputs
-- Testing for FE_TONEAREST in x range [0x0, 0xfc00), y range [0x0, 0xfc00) --
100% is in process
Test PASSED
-- Testing for FE_UPWARD in x range [0x0, 0xfc00), y range [0x0, 0xfc00) --
100% is in process
Test PASSED
-- Testing for FE_DOWNWARD in x range [0x0, 0xfc00), y range [0x0, 0xfc00) --
100% is in process
Test PASSED
-- Testing for FE_TOWARDZERO in x range [0x0, 0xfc00), y range [0x0, 0xfc00) --
100% is in process
Test PASSED
[ OK ] LlvmLibcAtan2f16ExhaustiveTest.AllInputs (136240512 ms)
Ran 1 tests. PASS: 1 FAIL: 0
```
https://github.com/llvm/llvm-project/pull/183531
More information about the libc-commits
mailing list