bugGNU Common Lisp - Bugs: bug #15872, atanh branch cut strangeness

 
 

bug #15872: atanh branch cut strangeness

Submitter:  None
Submitted:  Wed 22 Feb 2006 08:39:36 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 14 Feb 2021 05:39:20 PM UTC, comment #4: 

I think the principal value (ppv) of atanh is
atanh(z)= 0.5*(log(1+z) -log(1-z)). This is the value used in fortran and Mathematica (unlike some other programming languages like Matlab and SBCL).

We cannot use
atanh(z) = 0.5*log((1+z)/(1-z)) this won't give the ppv.




Francisco <fco_p>
Thu 02 Mar 2006 05:43:16 PM UTC, comment #3: 

OK, done.

Take care,

Camm Maguire <camm>
Group administrator
Thu 02 Mar 2006 03:36:17 PM UTC, comment #2: 

Camm, I'm sorry, but after further study of CLHS I've decided that GCL was correct to begin with, and I'd like to ask you to revert to the previous version of ATANH.

CLHS is, to the best of my knowledge, inconsistent about ATANH: there is a formula ((log(1 + x) - log(1 - x))/2 and there is the statement about branch cuts, and the formula implies branch cuts which are different from the statement.

((log(1 + x) - log(1 - x))/2 implies the branch cuts are (-\infty, -1) continuous with 2nd quadrant and (1, \infty) continuous with 4th. That's just what GCL was doing before.

In summary, please revert ATANH.

Robert Dodier
-email is unavailable-

Anonymous
Sat 25 Feb 2006 07:15:54 PM UTC, comment #1: 

Greetings, and thanks for the report!  This should be fixed now in cvs head and 2.6.8pre.

take care,

Camm Maguire <camm>
Group administrator
Wed 22 Feb 2006 08:39:36 PM UTC, original submission:  

GCL 2.6.7 seems to have wrong behavior for branch cut of atanh.
I also checked acos and asin and those 2 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.

GCL: 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.

GCL: 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))

Submitted by Robert Dodier (robert.dodier@gmail.com)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by fco_p (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-02-25 camm StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code