After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627775 - impower(-1,complex(0,1))
impower(-1,complex(0,1))
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
git master
Other All
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-08-23 22:01 UTC by Andreas J. Guelzow
Modified: 2010-08-23 23:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2010-08-23 22:01:53 UTC
impower(-1,complex(0,1)) evaluates to #DIV/0!

Since impower(x,y) should be imexp(improduct(y,imln(x))) which is defined everywhere but for x = 0, this is surprising.

Note that imexp(improduct(y,imln(x))) for x = -1 and y = complex(0,1) evaluates to 0.04321391826377 which is in fact the correct answer for impower(-1,complex(0,1)).
Comment 1 Morten Welinder 2010-08-23 22:35:20 UTC
imln isn't well defined on the negative part of the real axis.  (Or any
other halfline from the origin that one might choose when defining imln.)

That, of course, is not a good argument about what -1^i should be.

I notice that we have both go_complex_pow and complex_pow.
Comment 2 Andreas J. Guelzow 2010-08-23 22:59:20 UTC
Of course we can put the branch cut anywhere we like (and it would even need to be a straight halfline) . But there really isn't a reason not to cover the whole complex plane with the exception of the origin. 

I vote for having the branch cut of impower, imln and the other complex logarithms all in the same place.
Comment 3 Morten Welinder 2010-08-23 23:20:41 UTC
Fixed.  (Although I still need to move stuff over to goffice.)
Note, that we went away from the exp-log formula for accuracy reasons
a while ago.

We get the branch cut from complex_angle, so things should be consistent.