From: Christophe Rhodes <csr21@ca...>  20060222 22:04:29

"Robert Dodier" <robert.dodier@...> writes: > So far as I can tell, SBCL 0.9.9 doesn't conform to CLHS > (to judge by the test script appended to this message) for branch cuts of > the functions asin, acos, and atanh. I didn't check any other functions. > > (1) acos and asin: CLHS says > (http://www.lispworks.com/documentation/HyperSpec/Body/f_asin_.htm) > that the branch cut on [1, \infty) is continuous w/ 4th quadrant > and on (\infty, 1] is continuous w/ 2nd quadrant. > > SBCL: continuous w/ 1st and 2nd quadrants respectively > > (2) atanh: CLHS says > (http://www.lispworks.com/documentation/HyperSpec/Body/f_sinh_.htm) > that the branch cut on [1, \infty) is continuous w/ 1st quadrant > and on (\infty, 1] is continuous w/ 3rd quadrant. > > SBCL: continuous w/ 1st and 2nd respectively > > Thanks for your attention to this topic. This is nasty. I think that the essential problem, despite the best efforts of Steele (and Kahan) is that CL isn't quite right in this area. The question raised by your test script is: what does 2.5 mean in the complex plane? Is it 2.5+0.0i, 2.50.0i or 2.5+<exactly 0>i? Does 2.5 mean 2.5+0.0i, 2.50.0i or 2.5+<exactly 0>i? I suppose that the simple view would be that these real floats are on the axis, but unfortunately that's not what the rest of the spec says; (COMPLEX 2.5) is #c(2.5 0.0), but while (complex 2.5) is #c(2.5 0.0), according to the spec (IMAGPART 2.5) is 0.0. I think that the first thing to do is check whether or not the various trig functions obey the branch cuts when given arguments of type complex: that is, with an explicit positive or negative zero imaginary part. After that, we can discuss what the most useful interpretation of the real numbers in terms of the branch cuts are. (The reason I say CL doesn't get this quite right is that there's no pure imaginary floating point quantity, so composition of branch cuts can't work right no matter what choices are made.) You might also be interested in the ieeefptests project on commonlisp.net. Cheers, Christophe 