[Scilab-users] About the complex inverse tangent function

Pierre Vuillemin contact at pierre-vuillemin.fr
Thu Aug 14 15:12:13 CEST 2014


Hello,

my question concerns the practical implementation of the complex inverse
tangent function atan(z) in Scilab.

In the source code of Scilab, the file "watan.f" (in the elementary
functions) seems to compute this function as

atan(z) = i/2 log((i+z)/(i-z)),

where i^2=-1.

Yet, when comparing the result given by atan(z) and %i/2*log((%i+z)/(%
i-z)) in Scilab, they are different for every point on the imaginary
axis excepted in the unit circle. For instance,

z = 2*%i
disp([atan(z),%i/2*log((%i+z)/(%i-z))])

-> 1.5707963 + 0.5493061i  - 1.5707963 + 0.5493061i

I would like to know where does the difference comes from and if
'watan.f' is really the file that computes atan.

The values obtained with the function atan(z) seem to coincide with
another definition of atan(z) :

atan(z) = 1/(2i) [log(1+iz)-log(1-iz)]

which is used by Mathematica and the function 'catan' in linux.

Pierre











More information about the users mailing list