[libc-commits] [libc] [libc][math][c23] Add atanhf16 C23 math function. (PR #132612)

via libc-commits libc-commits at lists.llvm.org
Tue Apr 15 05:46:59 PDT 2025


================
@@ -297,6 +297,40 @@ LIBC_INLINE static double log2_eval(double x) {
   return result;
 }
 
+// x should be positive, normal finite value
+LIBC_INLINE static float log_eval_f(float x) {
+  // For x = 2^ex * (1 + mx), logf(x) = ex * logf(2) + logf(1 + mx).
+  using FPB = fputil::FPBits<float>;
+  FPB bs(x);
----------------
overmighty wrote:

Nit:

```suggestion
  using FPBits = fputil::FPBits<float>;
  FPBits xbits(x);
```

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


More information about the libc-commits mailing list