summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/tan.cpp
AgeCommit message (Collapse)Author
2025-08-09[libc][math] Refactor cos implementation to header-only in ↵Muhammad Bassiouni
src/__support/math folder. (#151883) Part of #147386 in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-04-08[libc][math] Fix signaling NaN handling for math functions. (#133347)wldfngrs
Add tests for signaling NaNs, and fix function behavior for handling signaling NaN input. Fixes https://github.com/llvm/llvm-project/issues/124812
2025-03-11[libc] Provide more fine-grained control of FMA instruction for ARM targets. ↵lntue
(#130700)
2024-10-26[libc][math] Add tests and fix some issues with FTZ/DAZ modes. (#113744)lntue
2024-10-10[libc][math] Improve performance of double precision trig functions. (#111793)lntue
- Improve the accuracy of fast pass' range reduction. - Provide tighter error estimations. - Reduce the table size when `LIBC_MATH_SMALL_TABLES` flag is set.
2024-08-09[libc] Moved range_reduction_double ifdef statement (#102659)RoseZhang03
Sin/cos/tan fuzzers were having issues with ONE_TWENTY_EIGHT_OVER_PI, so the LIBC_TARGET_CPU_HAS_FMA ifdef statement got moved from the sin/cos/tan .cpp files to the range_reduction_double_common.cpp file.
2024-07-12[libc] suppress uninitialized werrors (#98710)Schrodinger ZHU Yifan
suppress uninitialized werrors when building with gcc
2024-07-12[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)Petr Hosek
This is a part of #97655.
2024-07-12Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace ↵Mehdi Amini
declaration" (#98593) Reverts llvm/llvm-project#98075 bots are broken
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek
This is a part of #97655.
2024-07-08[libc] Add config option for fast math optimizations (#98029)Joseph Huber
Summary: This patch adds `LIBC_COPT_MATH_OPTIMIZATIONS` that allows users to configure the different math optimizations.
2024-07-08[libc] Add maybe_unused for functions only used on slow path (#98024)Joseph Huber
Summary: When the fast math options are enabled these functions are uncalled, which makes it error.
2024-07-03[libc][math] Implement correctly rounded double precision tan (#97489)lntue
Using the same range reduction as `sin`, `cos`, and `sincos`: 1) Reducing `x = k*pi/128 + u`, with `|u| <= pi/256`, and `u` is in double-double. 2) Approximate `tan(u)` using degree-9 Taylor polynomial. 3) Compute ``` tan(x) ~ (sin(k*pi/128) + tan(u) * cos(k*pi/128)) / (cos(k*pi/128) - tan(u) * sin(k*pi/128)) ``` using the fast double-double division algorithm in [the CORE-MATH project](https://gitlab.inria.fr/core-math/core-math/-/blob/master/src/binary64/tan/tan.c#L1855). 4) Perform relative-error Ziv's accuracy test 5) If the accuracy tests failed, we redo the computations using 128-bit precision `DyadicFloat`. Fixes https://github.com/llvm/llvm-project/issues/96930