[libc-commits] [PATCH] D79278: [libc] Fix how math results are compared with MPFR results.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri May 1 17:27:19 PDT 2020


sivachandra created this revision.
sivachandra added reviewers: abrachet, phosek.
Herald added subscribers: libc-commits, tschuett.
Herald added a project: libc-project.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79278

Files:
  libc/utils/MPFRWrapper/MPFRUtils.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79278.261582.patch
Type: text/x-patch
Size: 4084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200502/c812a2d6/attachment-0001.bin>


More information about the libc-commits mailing list