[PATCH v2 23/25] math: Use coshf from CORE-MATH

Vincent Lefevre vincent@vinc17.net
Wed Dec 18 17:51:27 GMT 2024


On 2024-12-18 11:41:11 -0300, Adhemerval Zanella Netto wrote:
> And we also removed some slow patch that in theory allowed better
> correctness [1], but where most likely it was using a much more precision
> required for correctly rounded (CORE-MATH does uses multiprecision for
> binary64, but with a more precise accuracy range). 

Yes, it was using 768 bits in the slow path, while around 120 bits
should be sufficient in general. For several functions, I determined
the hardest-to-round cases (this knowledge is used by CORE-MATH),
so that it is possible to get efficient implementations with
guaranteed correct rounding (assuming no bugs). For the other
functions (such as sin, cos, tan, pow), each additional bit of
accuracy of the intermediate result will decrease the probability
of incorrect rounding by a factor 2 (so the 768 bits of the IBM
implementation was overkill).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Libc-alpha mailing list