[all-commits] [llvm/llvm-project] a7e114: [libc] Fix how math results are compared with MPFR...
Siva Chandra via All-commits
all-commits at lists.llvm.org
Wed May 6 10:48:06 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: a7e11496996269fc589322da7bedbe4b1adcb13f
https://github.com/llvm/llvm-project/commit/a7e11496996269fc589322da7bedbe4b1adcb13f
Author: Siva Chandra Reddy <sivachandra at google.com>
Date: 2020-05-06 (Wed, 06 May 2020)
Changed paths:
M libc/utils/MPFRWrapper/MPFRUtils.cpp
Log Message:
-----------
[libc] Fix how math results are compared with MPFR results.
Summary:
Math results are compared with MPFR results by checking if they are
within a tolerance level of the MPFR result. The tolerance level is set
using additional bits of precision of the fractional part of a floating
point value. Hence, the actual value of the tolerance depends on not
only the additional bits, but also on the exponent part of the floating
point number.
Previously, the exponent part was not considered in evaluating the
tolerance value. While it was OK for small values less than 1 (hence
sinf, cosf, sincosf tests were OK), it breaks for large values which
functions like exp and friends produce. This change uses the exponent
value also to evaluate the tolerance value. LLVM libc produced results
can now be compared with MPFR produced results for large values also.
Reviewers: abrachet
Differential Revision: https://reviews.llvm.org/D79278
More information about the All-commits
mailing list