|j^j and the HP-33S|
Message #1 Posted by Karl Schneider on 27 Nov 2004, 11:57 p.m.
An unintuitive mathematical fact:
jj = e-pi/2 = 0.207879576
where j = sqrt(-1) and j2 = -1
The proof (which is left as an exercise for the reader) requires the use of Euler's identity and trigonometric/hyperbolic identities derived therefrom:
ejx = (cos x) + j*(sin x)
sin jx = j * sinh x
cos jx = cosh x
On any RPN or RPL calculator designed and engineered by Hewlett-Packard with complex-number capabilities, jj can always be evaluated correctly. For example:
f Re<->Im ENTER
y^x f CMPLX
For the 32S, 32SII, 33S, and 41C* with Math or Advantage ROM, a different approach is used:
f CMPLXy^x XEQ Z^W
This procedure works for all four calculators, but the 33S gives the incorrect answer e-3*pi/2 = 0.008983291 when the zero in the z-register is negated (-0).
The root cause of this problem is the same one that causes the incorrect rectangular-to-polar conversions with 0 or -0 in the x-register, which I and others documented fully, several months ago in this forum.
Calculation of jj requires the calculation of ln(j).
Re [ln(a+jb)] = ln (sqrt(a2+b2))
Im [ln(a+jb)] = atan2(a, b) [in radians] -- primary solution
The antilogarithm of the j residing in the "upper" part of the stack is taken. Since the 33S calculates the phase angle of (-0 + j1) incorrectly, the answer given for j^j is incorrect.
Norris (or anyone else), has HP addressed the polar-angle and other bugs?
Edited: 28 Nov 2004, 12:01 a.m.