[all-commits] [llvm/llvm-project] 434bf1: [libc][math] Implement double precision exp functi...
lntue via All-commits
all-commits at lists.llvm.org
Thu Aug 24 07:17:35 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 434bf1608445fd4b529ac4a3a43f1351dc657ab6
https://github.com/llvm/llvm-project/commit/434bf1608445fd4b529ac4a3a43f1351dc657ab6
Author: Tue Ly <lntue at google.com>
Date: 2023-08-24 (Thu, 24 Aug 2023)
Changed paths:
M libc/config/darwin/arm/entrypoints.txt
M libc/config/linux/aarch64/entrypoints.txt
M libc/config/linux/riscv64/entrypoints.txt
M libc/config/linux/x86_64/entrypoints.txt
M libc/config/windows/entrypoints.txt
M libc/docs/math/index.rst
M libc/spec/stdc.td
M libc/src/__support/FPUtil/PolyEval.h
M libc/src/__support/FPUtil/double_double.h
M libc/src/__support/FPUtil/dyadic_float.h
M libc/src/__support/FPUtil/multiply_add.h
M libc/src/math/CMakeLists.txt
A libc/src/math/exp.h
M libc/src/math/generic/CMakeLists.txt
A libc/src/math/generic/exp.cpp
M libc/test/src/math/CMakeLists.txt
A libc/test/src/math/exp_test.cpp
M libc/test/src/math/log10_test.cpp
Log Message:
-----------
[libc][math] Implement double precision exp function correctly rounded for all rounding modes.
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.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D158551
More information about the All-commits
mailing list