[libc-commits] [PATCH] D129215: [libc][math] Universal exp function for cosh/sinh calculation.
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Jul 19 21:19:39 PDT 2022
lntue added inline comments.
================
Comment at: libc/src/math/generic/expxf.h:45
+
+// Value to add to make integer digits always positive.
+// Needed for correct rounding to the nearest value in both positive and
----------------
Can you add the range restriction for `x` in here, since it does not work for the whole double precision range?
================
Comment at: libc/src/math/generic/expxf.h:57
+ fputil::FPBits<double> bs;
+ bs.set_unbiased_exponent(fputil::FPBits<double>::EXPONENT_BIAS + dg);
+ ml = EXP_2_POW[table_index];
----------------
Since in both `sinhf` and `coshf`, you have: `0.5 * ep`, maybe you can fuse that `* 0.5` here by:
```
bs.set_unbiased_exponent(fputil::FPBits<double>::EXPONENT_BIAS - 1 + dg)
```
If so, don't forget to update the comment about the returned value of `mult_exp`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129215/new/
https://reviews.llvm.org/D129215
More information about the libc-commits
mailing list