[libc-commits] [PATCH] D84725: [libc] Add ULP function to MPFRNumber class to test correctly rounded functions such as SQRT, FMA.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Aug 13 08:09:07 PDT 2020


lntue marked an inline comment as done.
lntue added inline comments.


================
Comment at: libc/utils/MPFRWrapper/MPFRUtils.cpp:230
+  __llvm_libc::fputil::testing::describeValue(
+      "   MPFR rounded: ", toFloatingPoint<T>(mpfrResult), OS);
+  OS << '\n';
----------------
sivachandra wrote:
> In what circumstances would a rounded MPFR result help understand a test failure?
When the ULP error is exactly 0.5, the ULP value itself is not enough to check if the rounding is correct.  This should never happen with SQRT function, but other one like HYPOT or FMA might be able to hit exactly 0.5 ULP.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84725/new/

https://reviews.llvm.org/D84725



More information about the libc-commits mailing list