<div dir="auto">Hey David, </div><div dir="auto">Create a tracking ticket on the ghc for the set of changes / issues you wanna address and how, and @ me on it  (I’ll then make sure to at other applicable Dolan )and I’ll try to help you get oriented and make sure it has the right visibility so we can help you out! </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 18, 2021 at 12:00 PM David James <<a href="mailto:davjam@live.com">davjam@live.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi thanks for the comments. I actually have draft rewrites of the Haskell complex functions with (I think) the correct behaviour, including branch cuts. But I discovered the errors in the underlying real functions while testing them. I’d like to try fixing all of these, but will probably need some help. <br>
<br>
Are there instructions somewhere on the process to fix a bug (presumably forking in GitHub, fixing code, adding test cases, running some CI, both for Linux and Windows, etc)? (And is there something similar for fixing mingle-w64 bugs?)<br>
<br>
I’ve been developing more test cases (esp for infinities +/-0, etc), but if there are any ideas/references on how to thoroughly test real or complex functions, that would also be useful. <br>
<br>
I’m currently away (and struggling to type on a phone) but will send more details (and pictures based on those in Common Lisp The Language 2nd edition) when I’m back. <br>
<br>
Thanks! David. <br>
<br>
<br>
<br>
> On 17 Sep 2021, at 22:06, Barak A. Pearlmutter <<a href="mailto:barak@pearlmutter.net" target="_blank">barak@pearlmutter.net</a>> wrote:<br>
> <br>
> I suspect that most implementations of Common Lisp just call the C<br>
> standard library catan(3) etc, which are well tuned.<br>
> <br>
> $ clisp<br>
> Welcome to GNU CLISP 2.49.92 (2018-02-18) <<a href="http://clisp.org/" rel="noreferrer" target="_blank">http://clisp.org/</a>><br>
> [1]> (atan #c(0 1d-40))<br>
> #C(0 1.0d-40)<br>
> <br>
> In this particular case, the problem is that the Haskell Data.Complex<br>
> code has its own implementation of atan, which uses a log(1 + x) in<br>
> calculating the imaginary part. A foreign function call to the<br>
> appropriate libm routine would robustly address this, but that would<br>
> be difficult because it's trying to be generic over RealFloat a =><br>
> Complex a, instead of special casing Complex Float / Complex Double.<br>
> Anyway, the Standard Prelude code for this is naïve: it should call<br>
> log1p, at the very least—which it actually goes to the trouble of<br>
> defining correctly, but not exporting.<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.<br>
</blockquote></div></div>