[Haskell-cafe] Numerics (was: Re: Trouble with asinh)
carter.schonwald at gmail.com
Fri Sep 17 17:16:21 UTC 2021
Hey Barak, is Common Lisp the only extant language to take those issues
seriously or are there other examples or better ones?
(i bought the common lisp book a year or so ago because its one of the few
references i could that talk about language/ library design for numerics /
branch cuts etc)
please edumacate me :)
On Fri, Sep 17, 2021 at 12:18 PM Barak A. Pearlmutter <barak at pearlmutter.net>
> The numerics in Haskell have not been carefully vetted, for a variety
> of reasons. Not just under MS Windows, even under Linux. Here's an
> example: atan has drastic loss of precision in the imaginary direction
> around zero in the complex domain.
> $ ghci
> GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
> Prelude> :m + Data.Complex
> Prelude Data.Complex> tan (1e-20 :+ 0)
> 1.0e-20 :+ 0.0
> Prelude Data.Complex> atan (1e-20 :+ 0)
> 1.0e-20 :+ (-0.0)
> Prelude Data.Complex> tan (0 :+ 1e-20)
> 0.0 :+ 1.0e-20
> Prelude Data.Complex> atan (0 :+ 1e-20)
> 0.0 :+ (-0.0)
> Although there have been amazing efforts to use fancy PLT methods to
> improve the numerics of programs using source-to-source
> transformations and such, the boring janitorial work of checking and
> fixing numeric issues in the standard library doesn't seem to attract
> people. To be fair, it isn't my cup of tea either...
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe