summaryrefslogtreecommitdiff
path: root/libc/test/src/math/smoke/tan_test.cpp
AgeCommit message (Collapse)Author
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
2024-10-26[libc][math] Add tests and fix some issues with FTZ/DAZ modes. (#113744)lntue
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