On 2025-01-02 02:48, Paul Zimmermann wrote:
> I see that this bug reported almost 4 years ago is still in newlib-4.5.0:
> https://sourceware.org/pipermail/newlib/2021/018230.html
>
> #include <stdio.h>
> #include <math.h>
>
> int main()
> {
> long double x = 0xf.ffffffffffffffep+8188l;
> long double y = (long double) 0;
> long double z = hypotl (x, y);
> printf ("x=%La y=%La z=%La\n", x, y, z);
> x = 0xf.fffffffffffffffp+8188l;
> z = hypotl (x, y);
> printf ("x=%La y=%La z=%La\n", x, y, z);
> x = 0x1p+8192l;
> z = hypotl (x, y);
> printf ("x=%La y=%La z=%La\n", x, y, z);
> return 0;
> }
>
> $ ./a.out
> x=0xf.ffffffffffffffep+8188 y=0x0p+0 z=0xf.ffffffffffffffep+8188
> x=0xf.fffffffffffffffp+8188 y=0x0p+0 z=-0xcp+16380
> x=0x8p+8189 y=0x0p+0 z=inf
>
> Happy New 1^3 + 2^3 + ... + 9^3 !
À la vôtre, bonne année en vingt cents vingt-cinq, grand nez! ;^>
Could you please recommend a BSD/MIT licensed source of better rounded hypotl
calculations, or advise on defects and recommendations for the current release?
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.