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

arata, mizuki minorinoki at gmail.com
Fri Sep 3 12:42:59 UTC 2021

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.


More information about the Haskell-Cafe mailing list