I've had some responses to my pleas for assistance on #90.
Bradley Lucier has commented on the ticket itself, but he also replied
to me first, which I shall reproduce the relevant parts of here:
> I’ve given a lot of thought to the interaction between exact and inexact “numbers” in numerical programming, most recently and most notably in the question of how to program inverse trigonometric and hyperbolic functions of complex arguments.
>
> Vel Kahan’s paper
>
>
> Kahan, W: Branch cuts for complex elementary functions;
>
> or, Much ado about nothing's sign bit. In Iserles, A., and Powell, M. (eds.),
>
> The state of the art in numerical analysis. Clarendon Press (1987) pp 165-211.
>
> is more or less the “bible” of the subject, and it’s followed by CMUCL, SBCL, Chez Scheme, Julia, Python, …. (While Racket is built on Chez, it does not in fact adopt wholesale the numerical libraries of Chez.)
>
> What I find interesting about the paper is that Kahan considers two general systems of floating-point arithmetic, one with two signed zeroes (as in IEEE arithmetic of various flavors) and one with a single, unsigned zero. There are subtle, but significant, differences in algorithms for the two systems.
>
> I consider a numerical system as implemented in Gambit, where the real or imaginary parts of a “number” may independently be exact or inexact, as a *combination* of the two systems Kahan considers. That led me, in implementing Gambit’s version of Kahan’s routines, to combine, in some sense, Kahan’s two approaches, applying Kahan’s “unsigned zero” approach when a component of a complex number is exact zero, and Kahan’s “signed zero” approach when a component is an inexact, signed, IEEE arithmetic zero.
>
> I didn’t mark such ideas in the code, so I can’t pull out an example on short notice, but if you’re asking whether the exactness or sign of a zero imaginary part of a number makes any difference in numerical results, I can offer the following examples:
>
>
>> gsi
>
> Gambit v4.9.7-40-ge547ae94
>
>
>> (atanh 1.+0.i)
>
> +inf.0+.7853981633974483i
>
>> (atanh 1.-0.i)
>
> +inf.0-.7853981633974483i
>
>> (atanh 1.+0i)
>
> +inf.0
>
>> (atanh 1+0.i)
>
> +inf.0+.7853981633974483i
>
>> (atanh 1-0.i)
>
> +inf.0-.7853981633974483i
>
>> (atanh 1+0i)
>
> *** ERROR IN (stdin)@7.1-7.13 -- (Argument 1) Out of range
>
> (atanh 1)
>
> 1>
>
> (This is with yesterday’s Github head after fixes I made when considering this example.).
>
> So different results can arise (and I believe should arise) depending on whether the imaginary part of the argument is an exact zero or a signed inexact zero.
>
> So I believe a distinction should be made between numbers that have exact real zero imaginary parts and numbers that have inexact real zero imaginary parts; calling that predicate “real?” seems good to me.
I also heard back from Mike Sperber:
[regarding the R6RS rationale]
> I put the wording in the rationale, so that is my "final statement".
--
Alaric Snell-Pym (M0KTN neé M7KIT)
http://www.snell-pym.org.uk/alaric/