Hello Pierre,

Le 15/08/2014 10:52, Pierre Vuillemin a écrit :
Le jeudi 14 août 2014 à 19:46 +0200, Samuel Gougeon a écrit :
With Scilab 5.5.0 on Windows 7 x64:
-->z = 2*%i
  z  =
     2.i
-->disp([atan(z),%i/2*log((%i+z)/(%i-z))])
1.5707963 + 0.5493061i 1.5707963 + 0.5493061i
I am on a 64-bit linux environment (Debian Jessie, Scilab 5.5.0), the
result would be OS-dependent?
It is possible. Some packages or/and some single functions -- including maths ones -- depend on the OS.
The relation

log(ab) = log(a) + log(b)

only stands for the multi-valued logarithm function (or modulo pi). With
the principal value of the log, defined as

log(z) = ln(|z|) + i * arg(z)

where -pi<arg(z)<=pi,
Is this interval conventionnaly standard for the principal value, rather than -pi <= arg(z) < pi ?
this is not true as soon as -pi<arg(a)+arg(b)<=
pi. In particular, it is not true on the branch cut (- inf, 0].
For instance,

log(-1) = j pi

log(-1)+log(-1) = 2j pi != log(1) = 0
It is, modulo 2.pi : i.2.pi [2.pi] ~ i.0 = 0
This is merely a problem of convention in the definitions, but this
leads to differences in the value of the atan on its branch cuts.
Indeed. Both results that you get from atan and log on Linux are correct, and equivalent.
Results from win7 are equal and agree with the standard interval (-pi, pi].

Samuel

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to