[libc] [llvm] [libc][math] Refactor exp implementation to header-only in src/__support/math folder. (PR #148761)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 14 19:47:52 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- libc/shared/math/exp.h libc/src/__support/math/exp.h libc/src/__support/math/exp_constants.h libc/src/__support/math/exp_utils.h libc/shared/math.h libc/src/math/generic/common_constants.cpp libc/src/math/generic/common_constants.h libc/src/math/generic/exp.cpp libc/src/math/generic/explogxf.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/__support/math/exp.h b/libc/src/__support/math/exp.h
index 5c8ea0896..a538df1e8 100644
--- a/libc/src/__support/math/exp.h
+++ b/libc/src/__support/math/exp.h
@@ -161,7 +161,7 @@ static Float128 exp_f128(double x, double kd, int idx1, int idx2) {
// Compute exp(x) with double-double precision.
static DoubleDouble exp_double_double(double x, double kd,
- const DoubleDouble &exp_mid) {
+ const DoubleDouble &exp_mid) {
// Recalculate dx:
// dx = x - k * 2^-12 * log(2)
double t1 = fputil::multiply_add(kd, MLOG_2_EXP2_M12_HI, x); // exact
``````````
</details>
https://github.com/llvm/llvm-project/pull/148761
More information about the llvm-commits
mailing list