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

Paul Zimmermann via libc-commits libc-commits at lists.llvm.org
Mon Dec 20 06:08:44 PST 2021


       Dear Santosh,

> Here is a revised polynomial that uses the current polynomial evaluation and produces correct results for all rounding modes and all inputs with zero violated inputs:
> 
> Polynomial: y=-3.2945312494298684154217536821552091564491707891340621650044795387657359e-16 x^(0) + 1.4426950408890866217603843324468471109867095947265625000000000000000000e+00 x^(1) + -7.2134752022691861483849606884177774190902709960937500000000000000000000e-01 x^(2) + 4.8089833027421252653610395100258756428956985473632812500000000000000000e-01 x^(3) + -3.6069225263970772221711058591608889400959014892578125000000000000000000e-01 x^(4) + 2.8949201646411226729327381690382026135921478271484375000000000000000000e-01 x^(5)

this polynomial has a non-zero constant term, unlike the polynomial used in
this patch, and the one produced by Sollya. How can it fit the current
framework (see below)?

  double r = __llvm_libc::fputil::polyeval(
      d, extra_factor, 0x1.71547652c2801p+0, -0x1.715476ec167eep-1,
      0x1.ec72eb4428a1ap-2, -0x1.72fd9daa7714fp-2, 0x1.8be682a823a9bp-2);

Best regards,
Paul



More information about the libc-commits mailing list