accuracy of asinh and atanh

Matt Peddie mpeddie at gmail.com
Wed Aug 1 23:59:16 UTC 2018


Hi George,

Not a stupid question.  I don't have a single source at hand, but I
think I read in a few places on the wiki that calling out to the
system math library is not an option due to the variety of system math
libraries on the platforms GHC supports.  It'd be great if I got the
wrong impression and this could just be a call to C.  Can anyone set
me straight on this point?

Matt

On Thu, Aug 2, 2018 at 5:13 AM, George Colpitts
<george.colpitts at gmail.com> wrote:
> Hello Mat
>
> Just curious, why the preferred solution isn't to call the system math
> library? As it says in the README you reference below,
>
> One good solution would be to always call the system math library for these
> functions.
>
> Hope this is isn't a stupid question.
>
> Thanks
>
> George
>
>
>
>
>
> On Sat, Jun 2, 2018 at 2:23 AM Matt Peddie <mpeddie at gmail.com> wrote:
>>
>> Hi devs,
>>
>> I tried to use  asinh :: Double -> Double  and discovered that it's
>> inaccurate compared to my system library (GNU libm), even returning
>> -Infinity in place of finite values in the neighborhood of -22 for
>> large negative arguments.  `atanh` is also inaccurate compared to the
>> system library.  I wrote up a more detailed description of the problem
>> including plots in the README file at
>> https://github.com/peddie/ghc-inverse-hyperbolic -- this repository is
>> package that can help you examine the error for yourself or generate
>> the plots, and it also contains accurate pure-Haskell translations of
>> the system library's implementation for these functions.  What's the
>> next step to fixing this in GHC?
>>
>> Cheers
>>
>> Matt Peddie
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


More information about the ghc-devs mailing list