aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorlntue <35648136+lntue@users.noreply.github.com>2023-09-28 16:43:15 -0400
committerGitHub <noreply@github.com>2023-09-28 16:43:15 -0400
commitda28593d71a8581bdcf6b99346e1cd625076aaff (patch)
tree505442d6bdcbf2d2e5eba795a3cf1cc7ddec0264 /clang/lib/Basic/SourceManager.cpp
parentd28a782542aff50abf2b072780748ce57d982705 (diff)
downloadllvm-da28593d71a8581bdcf6b99346e1cd625076aaff.zip
llvm-da28593d71a8581bdcf6b99346e1cd625076aaff.tar.gz
llvm-da28593d71a8581bdcf6b99346e1cd625076aaff.tar.bz2
[libc][math] Implement double precision expm1 function correctly rounded for all rounding modes. (#67048)
Implementing expm1 function for double precision based on exp function algorithm: - Reduced x = log2(e) * (hi + mid1 + mid2) + lo, where: * hi is an integer * mid1 * 2^-6 is an integer * mid2 * 2^-12 is an integer * |lo| < 2^-13 + 2^-30 - Then exp(x) - 1 = 2^hi * 2^mid1 * 2^mid2 * exp(lo) - 1 ~ 2^hi * (2^mid1 * 2^mid2 * (1 + lo * P(lo)) - 2^(-hi) ) - We evaluate fast pass with P(lo) is a degree-3 Taylor polynomial of (e^lo - 1) / lo in double precision - If the Ziv accuracy test fails, we use degree-6 Taylor polynomial of (e^lo - 1) / lo in double double precision - If the Ziv accuracy test still fails, we re-evaluate everything in 128-bit precision.
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions