[libc][math] Update range reduction step for log10f and reduce its latency.
commit9af8dca70fce1538675a857e3a053f6d35b18aea
authorTue Ly <lntue.h@gmail.com>
Thu, 6 Apr 2023 13:26:16 +0000 (6 09:26 -0400)
committerTue Ly <lntue@google.com>
Fri, 7 Apr 2023 14:31:46 +0000 (7 10:31 -0400)
treee376fb085d25dff9b2129335d73383747971db63
parent3f4d16018d51c9deff8e7deb01cefcf52e966cd3
[libc][math] Update range reduction step for log10f and reduce its latency.

Simplify the range reduction steps by choosing the reduction constants
carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
precision, even without FMA instructions, and -2^-8 <= v < 2^-7.  This allows the
polynomial evaluations to be parallelized more efficiently.

Reviewed By: zimmermann6

Differential Revision: https://reviews.llvm.org/D147676
libc/docs/math/index.rst
libc/src/math/generic/common_constants.cpp
libc/src/math/generic/common_constants.h
libc/src/math/generic/log10f.cpp
libc/test/src/math/log10f_test.cpp