<div dir="ltr"><div>Hey Barak, is Common Lisp the only extant language to take those issues seriously or are there other examples or better ones?</div><div><br></div><div>(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)</div><div>please edumacate me :) <br></div><div>-Carter<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 17, 2021 at 12:18 PM Barak A. Pearlmutter <<a href="mailto:barak@pearlmutter.net">barak@pearlmutter.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The numerics in Haskell have not been carefully vetted, for a variety<br>
of reasons. Not just under MS Windows, even under Linux. Here's an<br>
example: atan has drastic loss of precision in the imaginary direction<br>
around zero in the complex domain.<br>
<br>
$ ghci<br>
GHCi, version 8.8.4: <a href="https://www.haskell.org/ghc/" rel="noreferrer" target="_blank">https://www.haskell.org/ghc/</a>  :? for help<br>
Prelude> :m + Data.Complex<br>
<br>
Prelude Data.Complex> tan (1e-20 :+ 0)<br>
1.0e-20 :+ 0.0<br>
<br>
Prelude Data.Complex> atan (1e-20 :+ 0)<br>
1.0e-20 :+ (-0.0)<br>
<br>
Prelude Data.Complex> tan (0 :+ 1e-20)<br>
0.0 :+ 1.0e-20<br>
<br>
Prelude Data.Complex> atan (0 :+ 1e-20)<br>
0.0 :+ (-0.0)<br>
<br>
Although there have been amazing efforts to use fancy PLT methods to<br>
improve the numerics of programs using source-to-source<br>
transformations and such, the boring janitorial work of checking and<br>
fixing numeric issues in the standard library doesn't seem to attract<br>
people. To be fair, it isn't my cup of tea either...<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>