Re: (a + ib)^(x + iy) on HP 15C Message #5 Posted by Karl Schneider on 30 July 2008, 2:10 a.m., in response to message #1 by Chris Dean
Hi, Chris 
Writing applications for the HP15C can be surprisingly rewarding, due to its verstile and extensive capabilities (albeit at slow computational speed).
One stellar attribute of the HP15C is the full domain and range of its complexnumber functionality. This was pioneering in handheld calculators in 1982, and still is rarely achieved in most of today's models. As George stated, you can simply use its builtin capability to calculate the complexvalued result of raising one complexvalued number to another complexvalued number. Of course, you notice that the HP15C display goes blank for a while during these extensive computations; even the Pioneerseries HP32S/32SII and HP42S (which are 12 times as fast) do not give results instantly for this calculation.
If your goal was to perform such a computation outside of complex mode, you should put rectangular<>polar conversions to good use:
(a + jb)^{(x + jy)}
= e^{ln[(a + jb)(x + jy)]}
= e^{[(x + jy)*ln(a + jb)]}
ln(a + jb) = ln a + jb + j*atan2(a, b) [radians]
and
e^{(c + jd)} = e^{c}*e^{jd}
So, you can use >P to calculate the logarithm using two reals. Then, after computing the complexvalued product, use >R with magnitude of 1.00 to find the exponential of the imaginaryvalued part, and multiply by the exponential of the realvalued part.
I'm fairly sure this is how the calculators do this internally. Several years ago, we noted that early versions of the HP33s did not do rectangular<>polar conversions properly, due to incorrect handling and calculation of angles. I showed that this bug affected the calculation of powers in the complex domain:
http://www.hpmuseum.org/cgisys/cgiwrap/hpmuseum/archv014.cgi?read=66246#66246
 KS
Edited: 3 Aug 2008, 12:55 a.m. after one or more responses were posted
