[Haskell-cafe] Trouble with asinh (c calls with Doubles) in Windows

Brandon Allbery allbery.b at gmail.com
Fri Sep 3 13:57:11 UTC 2021


I would also note that %f is the wrong printf flag to use with a double;
you want %d. This shouldn't affect the result since you're only printing
one value, but I don't know the Windows ABI so conceivably it might.

On Fri, Sep 3, 2021 at 8:43 AM arata, mizuki <minorinoki at gmail.com> wrote:

> Hi David,
>
> If I understand correctly, GHC uses mingw-w64’s libc implementation on
> Windows.
> Since mingw-w64’s math functions are not of very good quality, it is
> likely that asinh returns NaN for a very large input.
>
> As to why `asinh(1.7976931348623157e308)` in CAsinh.c produces
> (seemingly-correct) 710.4758, it is probably because the C compiler (GCC)
> uses a different implementation of asinh when doing constant folding.
> As a note, you may get a different (compile-time computed) result for
> `asinh(x)` if you set a more aggressive optimization flag.
>
> Mizuki
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210903/6322e88e/attachment.html>


More information about the Haskell-Cafe mailing list