[libc-commits] [libc] [libc][math] Fix atan2f128 when the exponent difference is larger than the precision. (PR #183552)
via libc-commits
libc-commits at lists.llvm.org
Thu Feb 26 08:25:32 PST 2026
================
@@ -25,4 +25,9 @@ TEST_F(LlvmLibcAtan2f128Test, SpecialNumbers) {
float128 y = 0x1.fffffffffffffffffffffffffff2p1q;
float128 r = 0x1.921fb54442d18469898cc51701b3p-1q;
EXPECT_FP_EQ(r, LIBC_NAMESPACE::atan2f128(x, y));
+
+ x = -0x1.f122e07fff556143p+3524q;
+ y = 0x1.f122e07fff55615b75p+6316q;
+ r = -0x1.ffffffffffffffe6cfcdc604fc99p-2793q;
+ EXPECT_FP_EQ(r, LIBC_NAMESPACE::atan2f128(x, y));
----------------
lntue wrote:
I just hate that C/C++ standards put `atan2(y, x)` instead of `atan2(x, y)`.
https://github.com/llvm/llvm-project/pull/183552
More information about the libc-commits
mailing list