bugGNU Scientific Library - Bugs: bug #22651, arccosh for complex numbers -...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #22651: arccosh for complex numbers - branch problem?

Submitter:  -Deleted Account- <bjg>
Submitted:  Tue 18 Mar 2008 08:43:04 AM UTC
   
 
Category:  Accuracy problem Severity:  3 - Normal
Operating System:  Status:  Invalid
Assigned to:  None Open/Closed:  Closed
Release:  1.11

Wed 19 Nov 2008 09:17:18 AM UTC, comment #1: 

The information given in the email was incorrect. GSL returns the correct value +0.96 for both real and complex versions of the function.

#include <gsl/gsl_complex_math.h>
#include <math.h>
#include <stdio.h>

int main ()
{
  gsl_complex z,f;
  double x, y, zero = 0.0;
  x = 1.5;
  y = acosh(x);
  GSL_SET_COMPLEX(&z, x, zero);
  f = gsl_complex_arccosh(z);
  printf("%.18e\n", x);
  printf("%.18e\n", y);
  printf("%.18e %.18e\n", GSL_REAL(z), GSL_IMAG(z));
  printf("%.18e %.18e\n", GSL_REAL(f), GSL_IMAG(f));
}


$ ./a.out
1.500000000000000000e+00
9.624236501192069415e-01
1.500000000000000000e+00 0.000000000000000000e+00
9.624236501192069415e-01 -0.000000000000000000e+00

-Deleted Account- <bjg>
Tue 18 Mar 2008 08:43:04 AM UTC, original submission:  

From: Charles R Harris <charlesr.harris <at> gmail.com>
Subject: arccosh for complex numbers, goofy choice of branch
Newsgroups: gmane.comp.python.numeric.general
Date: 2008-03-17 08:40:19 GMT (1 day ago)

OK,

Which branch do we want to use. As it currently is in numpy and scipy.special

arccosh(1.5) =  0.96242365011920694
arccosh(1.5+0j) =  -0.96242365011920705 + 0.0j

This is consistent with gsl, but inconsistent with Mathematica, NAG, Maple, and probably all sensible implementations which use the generally accepted principal value. I've left this inconsistency raising an error in the ufunc tests until we make a decision. It might be nice to know what FORTRAN and MatLab do with this.

Chuck

_____________________________________________
Numpy-discussion mailing list
Numpy-discussion <at> scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

-Deleted Account- <bjg>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2008-11-19 bjg StatusNeed Info Invalid
    Open/ClosedOpen Closed
    Release 1.11

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code