[libc] Add range reduction functions based on Paine and Hanek algorithm.
authorSiva Chandra Reddy <sivachandra@google.com>
Fri, 4 Jun 2021 06:12:50 +0000 (06:12 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Mon, 23 Aug 2021 05:18:41 +0000 (05:18 +0000)
commitca6b354229702ba9a36044f0941669ee82da8761
tree7192787459bda6d76ea72380c075436bc8ca7f3c
parent2c6ffb4eb20a2598148fdcc819e62f856ccaa373
[libc] Add range reduction functions based on Paine and Hanek algorithm.

These functions will be used in a future patch to implement
trigonometric functions. Unit tests have been added but to the
libc-long-running-tests suite. The unit tests long running because we
compare against MPFR computations performed at 1280 bits of precision.

Some cleanups or elimination of repeated patterns can be done as follow
up changes.

Differential Revision: https://reviews.llvm.org/D104817
libc/src/__support/FPUtil/CMakeLists.txt
libc/src/__support/FPUtil/UInt.h [new file with mode: 0644]
libc/src/__support/FPUtil/XFloat.h [new file with mode: 0644]
libc/src/math/generic/CMakeLists.txt
libc/src/math/generic/dp_trig.cpp [new file with mode: 0644]
libc/src/math/generic/dp_trig.h [new file with mode: 0644]
libc/test/src/math/CMakeLists.txt
libc/test/src/math/mod_k_pi_test.cpp [new file with mode: 0644]
libc/utils/MPFRWrapper/MPFRUtils.cpp
libc/utils/MPFRWrapper/MPFRUtils.h