[libc-commits] [PATCH] D115408: [libc] Implement correctly rounded logf based on RLIBM library.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Dec 13 09:51:34 PST 2021

lntue added a comment.

In D115408#3188352 <https://reviews.llvm.org/D115408#3188352>, @zimmermann6 wrote:

> maybe I did something wrong, but with the latest version I get two failures for x=0x1.2f1fd6p+3 and x=0x1.bacb4ap+25.
> If I disable the test for exceptional values I get five failures, those two and x=0x1.01a33ep+0, x=0x1.b121a6p+76 and 0x1.6351d8p+95.
> With the following minimax polynomial found using Sollya I get only four failures (the value x=0x1.01a33ep+0 is CR):
> 0.19620128080245119450708557451434899121522903442383 * x^5 + -0.24996749678377125358785804110084427520632743835449 * x^4 + 0.33333320666203714033315463893814012408256530761719 * x^3 + -0.49999999978385922805301788685028441250324249267578 * x^2 + 0.9999999999998795408018281705153640359640121459961 * x

Something is not right, since all of the failures that you found were already in the list of exceptional values:
(hexfloat, decimal, hex bits in float)
(0x0x1.01a33ep+0, 1.00639712810516357421875, **0x3f80d19f**)
(0x1.2f1fd6p+3, 9.47263622283935546875,  **0x41178feb**)
(0x1.bacb4ap+25, 58037908.0, **0x4c5d65a5**)
(0x1.b121a6p+76, 127837836949849943048192.0, **0x65d890d3**)
(0x1.6351d8p+95, 54983060754563292101907316736.0, **0x6f31a8ec**)

Nonetheless, after clearing the build cache and re-run the tests, I found 2 exceptional cases' results were off due to double-conversion when I tried to print their hexadecimal floats (inadvertently using intermediate doubles).
You might try clear the build cache and rerun the tests again.

  rG LLVM Github Monorepo



More information about the libc-commits mailing list