[libc-commits] [PATCH] D129215: [libc][math] Universal exp function for cosh/sinh calculation.

Kirill Okhotnikov via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jul 27 12:28:43 PDT 2022


orex added inline comments.


================
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];
----------------
lntue wrote:
> 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`.
But, for tanh, I think that will be a problem. I introduced more general implementation.


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