The GNU libc atanh is correctly rounded
Posted by matt_d 3 days ago
Comments
Comment by jcranmer 14 hours ago
For single-precision unary functions, it's easy enough to just exhaustively test every single input (there's only 4 billion of them). But double precision has prohibitively many inputs to test, so you have to resort to actual proof techniques to prove correct rounding for double-precision functions.
Comment by WalterGR 9 hours ago
I had to google this one…
ULP: “Unit in the Last Place” or “Unit of Least Precision: https://en.wikipedia.org/wiki/Unit_in_the_last_place
Comment by mananaysiempre 7 hours ago
Comment by adgjlsfhk1 9 hours ago
Comment by lifthrasiir 9 hours ago
Comment by SideQuark 4 hours ago
It absolutely does matter. The first, and most important reason, is one needs to know the guarantees of every operation in order to design numerical algorithms that meet some guarantee. Without knowing that the components provide, it's impossible to design algorithms on top with some guarantee. And this is needed in a massive amount of applications, from CAD, simulation, medical and financial items, control items, aerospace, and on and on.
And once one has a guarantee, making the lower components tighter allows higher components to do less work. This is a very low level component, so putting the guarantees there reduces work for tons of downstream work.
All this is precisely what drove IEEE 754 to become a thing and to become the standard in modern hardware.
> the problem is that languages traditionally rely on an OS provided libm leading to cross architecture differences
No, they don't not things like sqrt and atanh and related. They've relied on compiler provided libs since, well, as long as there have been languages. And the higher level libs, like BLAS, are built on specific compilers that provide guarantees by, again, libs the compiler used. I've not seen OS level calls describing the accuracy of the floating point items, but a lot of languages do, including C/C++ which underlies a lot of this code.
Comment by adgjlsfhk1 44 minutes ago
sure, but a 1 ulp guarantee works just as well here while being substantially easier to provide.
> And the higher level libs, like BLAS, are built on specific compilers that provide guarantees
Sure, but Blas doesn't provide any accuracy guarantees so it being built on components that sort of do has pretty minimal value for it. For basically any real application, the error you experience is error from the composition of intrinsics, not the composed error of those intrinsic themselves, and that remains true even if those intrinsics have 10 ULP error or 0.5 ULP error
Comment by fweimer 8 hours ago
Comment by gajjanag 3 hours ago
Most published libm on GPU/NPU side have a few ULP of error for the perf vs accuracy tradeoff. Eg, documented explicitly in the CUDA programming guide: https://docs.nvidia.com/cuda/cuda-programming-guide/05-appen... .
Prof. Zimmermann and collaborators have a great table at https://members.loria.fr/PZimmermann/papers/accuracy.pdf (Feb 2026) comparing various libm wrt accuracy.
Comment by adgjlsfhk1 52 minutes ago
Comment by ghighi7878 4 hours ago
Comment by adgjlsfhk1 59 minutes ago
Comment by RyJones 13 hours ago
Guy's world records get deleted due to changes in atanh over time
Comment by im3w1l 11 hours ago
Comment by dgaudet 10 hours ago
Comment by ncruces 6 hours ago
Comment by kergonath 15 hours ago
Lots of good stuff here: https://members.loria.fr/PZimmermann/papers/ .
Comment by nmbrskeptix 15 hours ago
It's linear for small x, and exponential for large. Lots of applications of this:
Compressing data
Mapping (zoomed in near by, zoned out from afar)
There's a whole class of electronics amps for this.
Comment by cyco130 4 hours ago
Comment by RandomTeaParty 13 hours ago
Comment by TimorousBestie 13 hours ago
Comment by mananaysiempre 6 hours ago
HAL is an institutional requirement, I believe.
Comment by jonathrg 15 hours ago
Comment by brcmthrowaway 13 hours ago
Comment by stephencanon 10 hours ago
I don’t know of any interesting work in this space that came out of Red Hat, why do you suggest them?
Comment by DiabloD3 10 hours ago
He doesn't work for Red Hat.
Comment by ameliaquining 10 hours ago