[libc-commits] [PATCH] D115828: [libc] Implement correctly rounded log2f based on RLIBM library.

Santosh Nagarakatte via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Dec 22 09:15:56 PST 2021

santoshn added a comment.

Here is a new polynomial that is generated using the exact output compensation in the patch. Tue suggested to use the FMA based poly eval as he was observing performance regressions with the SIMD instruction in x86-64.

Polynomial: y=1.4426950408936214387267682468518614768981933593750000000000000000000000e+00 x^(1) + -7.2134752892795794831926059487159363925457000732421875000000000000000000e-01 x^(2) + 4.8090233829603024062748772848863154649734497070312500000000000000000000e-01 x^(3) + -3.6137987525825709944626851211069151759147644042968750000000000000000000e-01 x^(4) + 3.2929554893140711158139311010017991065979003906250000000000000000000000e-01 x^(5)

Polynomial evaluation used is as follows:

double t1 = fma(x, a5, a4);
 double t2 = fma(x, t1, a3);
 double t3 = fma(x, t2, a2);
 double t4 = fma(x, t3, a1);

final result = fma(d, t4, extra_factor)

Can you check if it produces correctly rounded results for all inputs and all rounding modes?

In D115828#3204858 <https://reviews.llvm.org/D115828#3204858>, @santoshn wrote:

> Paul,
> Thanks. Let me investigate and test it out with the patch. I have been testing the polynomials with our framework. There seems to be subtle differences between the patch and our public RLIBM framework.
> Santosh

  rG LLVM Github Monorepo



More information about the libc-commits mailing list