Hi all – I now have fixes for all the issues I’m aware of. However, it’s quite possible I’ve made a mistake somewhere (either in the new code or the testing), so if anyone would like to help review either please let me know.

 

Group 1 issues (real numbers in Windows, where the defects are in mingw-w64: I’ve raised issue #20424 for this. The fixes (commits 66ba5f32 and 021dffb8a) have been made in mingw-w64 and are getting integrated into Haskell soon.

 

Group 2 issues (complex numbers, where the defects are in Complex.hs). I’ve raised issue #20425 for this and have the code fixes here. The new code changes many of the functions (I’ve given examples in the issue) and adds a few. I’ve also put the Haddock output here. (It now defines and gives an explanation of the branch cuts). I’ve also put some diagrams here illustrating some of the problems.

 

I’ve done about as much testing as I can think of, using the code here. Ideally I’d bulk-test against a reliable independent source, but can’t find one. AFAICT WolframAlpha, Excel, gnumeric, CLISP don’t support negative zeros. Python seems to, but cmath has incorrect branch cuts (cmath.sqrt(-4-0j) gives 2j). Matlab also seems deficient in a number of areas. (Hmmm: maybe no one cares about these working correctly??)

 

Sorry about the delay in sending this, David.