From: SourceForge.net <no...@so...> - 2006-03-05 16:56:24
|
Bugs item #1436987, was opened at 2006-02-22 13:53 Message generated for change (Comment added) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1436987&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Robert Dodier (robert_dodier) Assigned to: Nobody/Anonymous (nobody) Summary: atanh branch cut strangeness Initial Comment: So far as I can tell, Clisp 2.34 (Linux, compiled w/ gcc 3.3.2) handles branch cuts of atanh incorrectly. I also checked asin and acos and those two functions seem OK. (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. Clisp: conforms to spec (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. Clisp: continuous w/ 4th and 2nd quadrants respectively PS. Here's a test script: (cl:asin #C(2.5 0.01)) (cl:asin 2.5) (cl:asin #C(2.5 -0.01)) (cl:asin #C(-2.5 0.01)) (cl:asin -2.5) (cl:asin #C(-2.5 -0.01)) (cl:acos #C(2.5 0.01)) (cl:acos 2.5) (cl:acos #C(2.5 -0.01)) (cl:acos #C(-2.5 0.01)) (cl:acos -2.5) (cl:acos #C(-2.5 -0.01)) (cl:atanh #C(2.5 0.01)) (cl:atanh 2.5) (cl:atanh #C(2.5 -0.01)) (cl:atanh #C(-2.5 0.01)) (cl:atanh -2.5) (cl:atanh #C(-2.5 -0.01)) ---------------------------------------------------------------------- >Comment By: Robert Dodier (robert_dodier) Date: 2006-03-05 09:56 Message: Logged In: YES user_id=501686 After further study of CLHS, I've concluded the statements about branch cuts for ATANH are inconsistent with the formula (log(1 + x) - log(1 - x))/2. The branch cuts as derived from the formula are (-\infty, -1) continuous w/ 2nd quadrant and (1, \infty) continuous w/ 4th. I think the only way to read the spec for ATANH is to read the stuff about branch cuts as commentary and ignore it (i.e., observe the formula and ignore the commentary). That said, there is still some strangeness in ATANH, namely that (ATANH -2.5) => #C(-0.42364892 1.5707964) which is different from (ATANH #C(-2.5 0.0)) => #C(-0.42364892 -1.5707964). Since Clisp doesn't recognize signed zero, I don't see how that can be. For the record, (IMAGPART -2.5) => 0 and (PHASE -2.5) => 3.1415927. In order to be consistent w/ (log(1 + x) - log(1 - x))/2, (ATANH #C(-2.5 0.0)) should yield #C(-0.42364892 1.5707964). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1436987&group_id=1355 |