diff options
| author | Joseph Huber <huberjn@outlook.com> | 2024-07-08 11:01:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-08 11:01:03 -0500 |
| commit | 12e47aabd4e4c6cec15092183b91ec279a0a7ab4 (patch) | |
| tree | d54a2c2abd71e1e6bae6a6b1a9b2325b50636110 /libc/src/math/generic/tan.cpp | |
| parent | 0577cdaa32b26c02e16822343e7039b999f43d58 (diff) | |
[libc] Add config option for fast math optimizations (#98029)
Summary:
This patch adds `LIBC_COPT_MATH_OPTIMIZATIONS` that allows users to
configure the
different math optimizations.
Diffstat (limited to 'libc/src/math/generic/tan.cpp')
| -rw-r--r-- | libc/src/math/generic/tan.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/src/math/generic/tan.cpp b/libc/src/math/generic/tan.cpp index 7f1385c4717d..d153cc53acc8 100644 --- a/libc/src/math/generic/tan.cpp +++ b/libc/src/math/generic/tan.cpp @@ -127,7 +127,8 @@ LIBC_INLINE DoubleDouble tan_eval(const DoubleDouble &u) { // Calculation a / b = a * (1/b) for Float128. // Using the initial approximation of q ~ (1/b), then apply 2 Newton-Raphson // iterations, before multiplying by a. -[[maybe_unused]] Float128 newton_raphson_div(const Float128 &a, Float128 b, double q) { +[[maybe_unused]] Float128 newton_raphson_div(const Float128 &a, Float128 b, + double q) { Float128 q0(q); constexpr Float128 TWO(2.0); b.sign = (b.sign == Sign::POS) ? Sign::NEG : Sign::POS; @@ -158,7 +159,7 @@ LLVM_LIBC_FUNCTION(double, tan, (double x)) { if (LIBC_UNLIKELY(x == 0.0)) return x; - // For |x| < 2^-27, |tan(x) - x| < ulp(x)/2. + // For |x| < 2^-27, |tan(x) - x| < ulp(x)/2. #ifdef LIBC_TARGET_CPU_HAS_FMA return fputil::multiply_add(x, 0x1.0p-54, x); #else |
