Re: [Haskell-cafe] Numerics (was: Re: Trouble with asinh)

Hey David,
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!
On Sat, Sep 18, 2021 at 12:00 PM David James
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.
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?)
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.
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.
Thanks! David.
On 17 Sep 2021, at 22:06, Barak A. Pearlmutter
wrote: I suspect that most implementations of Common Lisp just call the C standard library catan(3) etc, which are well tuned.
$ clisp Welcome to GNU CLISP 2.49.92 (2018-02-18) http://clisp.org/ [1]> (atan #c(0 1d-40)) #C(0 1.0d-40)
In this particular case, the problem is that the Haskell Data.Complex code has its own implementation of atan, which uses a log(1 + x) in calculating the imaginary part. A foreign function call to the appropriate libm routine would robustly address this, but that would be difficult because it's trying to be generic over RealFloat a => Complex a, instead of special casing Complex Float / Complex Double. Anyway, the Standard Prelude code for this is naïve: it should call log1p, at the very least—which it actually goes to the trouble of defining correctly, but not exporting. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (1)
-
Carter Schonwald