math: fix ld80 acoshl(x) for x < 0
commit6d10102709df4bc966d2846c1c45cd667e5048e5
authorSzabolcs Nagy <nsz@port70.net>
Fri, 18 Aug 2023 21:16:00 +0000 (18 23:16 +0200)
committerRich Felker <dalias@aerifal.cx>
Sat, 19 Aug 2023 18:07:44 +0000 (19 14:07 -0400)
tree6fd927698010a49a910bfed6923f882b909015ec
parent83b858f83b658bd34eca5d8ad4d145f673ae7e5e
math: fix ld80 acoshl(x) for x < 0

acosh(x) is nan for x < 1, but x < 0 cases were not handled specially
and acoshl gave wrong result for some -0x1p32 < x < -2 values, e.g.:

acoshl(-0x1p20) returned -inf,
acoshl(-0x1.4p20) returned -0x1.db365758403aa9acp+0L,

fixed by checking the sign bit and handling it specially.

reported by Paul Zimmermann.
src/math/acoshl.c