real number floating point function errors (Windows only)
Summary
Several mathematical functions (asinh, etc) on Double and Float give incorrect values (in Windows only).
Steps to reproduce
Evaluate the following in GHCi on Windows:
> asinh 0
-0.0
> atanh (-0)
0.0
> asinh 1e300
NaN
Expected behavior
> asinh 0
0.0
> atanh (-0)
-0.0
> asinh 1e300
691.4686750787736
(This is correct, and what you get in Linux).
Environment
- GHC version used: 8.10.7
Optional:
- Operating System: Windows
- System Architecture:
The third example here is the cause of issue #15670 (closed).
The cause seems to be errors in the coding of the functions in mingw-w64. I've created/updated bugs #515 and bug #916.
I've coded some fixes here.
The github repo also includes some tests (and I'm trying to develop more and may uncover additional issues). I'd like to include a fuller set of tests in both GHC and mingw-w64 (if it has CI testing).
The repo also has tests and fixes for complex number problems (that I'll raise as a separate issue since the fixes are in the GHC code).