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 HP-15C can be surprisingly rewarding, due to its verstile and extensive capabilities (albeit at slow computational speed).
One stellar attribute of the HP-15C is the full domain and range of its complex-number 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 built-in capability to calculate the complex-valued result of raising one complex-valued number to another complex-valued number. Of course, you notice that the HP-15C display goes blank for a while during these extensive computations; even the Pioneer-series HP-32S/32SII and HP-42S (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)
= eln[(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) = ec*ejd
So, you can use ->P to calculate the logarithm using two reals. Then, after computing the complex-valued product, use ->R with magnitude of 1.00 to find the exponential of the imaginary-valued part, and multiply by the exponential of the real-valued part.
I'm fairly sure this is how the calculators do this internally. Several years ago, we noted that early versions of the HP-33s 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/cgi-sys/cgiwrap/hpmuseum/archv014.cgi?read=66246#66246
-- KS
Edited: 3 Aug 2008, 12:55 a.m. after one or more responses were posted
|