[libc-commits] [PATCH] D158551: [libc][math] Implement double precision exp function correctly rounded for all rounding modes.
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Aug 22 14:07:58 PDT 2023
lntue created this revision.
lntue added reviewers: michaelrj, sivachandra, cqlauter, zimmermann6.
Herald added subscribers: luke, sunshaoce, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, arphaman, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb.
Herald added projects: libc-project, All.
lntue requested review of this revision.
Herald added a subscriber: wangpc.
Implement double precision exp function correctly rounded for all
rounding modes. Using 4 stages:
- Range reduction: reduce to `exp(x) = 2^hi * 2^mid1 * 2^mid2 * exp(lo)`.
- Use 64 + 64 LUT for 2^mid1 and 2^mid2, and use cubic Taylor polynomial to
approximate `(exp(lo) - 1) / lo` in double precision. Relative error in this
step is bounded by 1.5 * 2^-63.
- If the rounding test fails, use degree-6 Taylor polynomial to approximate
`exp(lo)` in double-double precision. Relative error in this step is bounded by
2^-99.
- If the rounding test still fails, use degree-7 Taylor polynomial to compute
`exp(lo)` in ~128-bit precision.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D158551
Files:
libc/config/darwin/arm/entrypoints.txt
libc/config/linux/aarch64/entrypoints.txt
libc/config/linux/riscv64/entrypoints.txt
libc/config/linux/x86_64/entrypoints.txt
libc/config/windows/entrypoints.txt
libc/docs/math/index.rst
libc/spec/stdc.td
libc/src/__support/CPP/type_traits.h
libc/src/__support/FPUtil/FMA.h
libc/src/__support/FPUtil/PolyEval.h
libc/src/__support/FPUtil/double_double.h
libc/src/__support/FPUtil/dyadic_float.h
libc/src/__support/FPUtil/multiply_add.h
libc/src/math/CMakeLists.txt
libc/src/math/exp.h
libc/src/math/generic/CMakeLists.txt
libc/src/math/generic/exp.cpp
libc/test/src/math/CMakeLists.txt
libc/test/src/math/exp_test.cpp
libc/test/src/math/log10_test.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158551.552501.patch
Type: text/x-patch
Size: 48998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230822/fbea672e/attachment-0001.bin>
More information about the libc-commits
mailing list