The Museum of HP Calculators

HP Forum Archive 06

[ Return to Index | Top of Index ]

HP32S/SII micro challenge
Message #1 Posted by J-F Garnier on 29 Oct 2001, 11:33 a.m.

I sometimes use my HP32S for simple calculations on complex numbers, thanks to the CMPLXxxx functions. However, I always regret the lack of CMPLXx<>y, CMPLXenter and CMPLXx^2. CMPLXx<>y can be easily done with RDN RDN (here, RDN means "R-Down-Arrow"). CMPLXx^2 could be done with CMPLXenter CMPLX*, if CMPLXenter was only existing.

Are you able to find a simple sequence that simulate CMPLXenter? (I mean a sequence which duplicates the complex number in x,y to z,t)

I just found a simple way after years of research (I'm hardly joking ...). So I'm curious to know if some of you are more clever than I was to find a solution.

I will post my solution in a few days.

      
Re: HP32S/SII micro challenge
Message #2 Posted by W. Bruce Maguire II on 29 Oct 2001, 1:02 p.m.,
in response to message #1 by J-F Garnier

>Are you able to find a simple sequence that simulate CMPLXenter? (I mean a sequence which duplicates the complex number in x,y to z,t)

OK,

I'll start the ball rolling. I'm sure there are better ways, but I came up with this sequence without any thought of minimizing steps. So, consider this a starting point:

KEYSTROKES:     REGISTER CONTENTS:
-----------     ------------------
<enter>         x,x,y,z
<enter>         x,x,x,y
-               0,x,y,y
X<>Y            x,0,y,y
Rv (roll down)  0,y,y,x
+               y,y,x,x
Rv              y,x,x,y
X<>Y            x,y,x,y
NOTE: I didn't actually try this---so I hope there aren't any mistakes! :-)
Bruce.
      
Re: HP32S/SII micro challenge
Message #3 Posted by Paul Kobayashi on 29 Oct 2001, 1:45 p.m.,
in response to message #1 by J-F Garnier

> Are you able to find a simple sequence that simulate CMPLXenter?

Is this the one?
0
1
CMPLX*

            
Re: HP32S/SII micro challenge
Message #4 Posted by Luca de Alfaro on 29 Oct 2001, 8:04 p.m.,
in response to message #3 by Paul Kobayashi

This is also simple, and it involves only ENTER, and stack manipulation.

x y ? ? ENTER x x y ? Rv Rv Y ? x x ENTER y y ? x R^ x y y ? ENTER x x y y R^ y x x y x <-> Y x y x y

So: ENTER Rv Rv ENTER R^ ENTER R^ X<->Y

which in total is 8 steps. I think it's nice that it only uses stack manipulation commands (i.e. no arithmetic).

A nicer sequence, that contains the minimum number of ENTER, is:

ENTER R^ R^ X<->Y Rv ENTER Rv X<->Y

which is also 8 steps.

Can anyone do better, or prove that it cannot be done better, with only R^, Rv, CLX, ENTER, X<->Y?

Luca

                  
Re: HP32S/SII micro challenge
Message #5 Posted by Rupert (Northern Italy, EU) on 30 Oct 2001, 5:15 p.m.,
in response to message #4 by Luca de Alfaro

>Can anyone do better, or prove that it cannot be done >better, with only R^, Rv, CLX, ENTER, X<->Y?

Try this:

Enter Enter R^ Enter Rv X<>Y

Just six steps. :)

Regards.

                  
Re: HP32S/SII micro challenge
Message #6 Posted by Rupert (Northern Italy (EU) on 31 Oct 2001, 4:37 p.m.,
in response to message #4 by Luca de Alfaro

>Can anyone do better, or prove that it cannot be done >better, with only R^, Rv, CLX, ENTER, X<->Y?

Other than the previous, I found the following solutions too:

Enter Enter CLx + R^ X<>Y

Enter R^ CLx + R^ X<>Y

I wasn't able to use less than six steps...

IMHO, the HP15C handles complex numbers calculations better than the HP32SII.

Regards.

            
Re: HP32S/SII micro challenge - my solution
Message #7 Posted by J-F Garnier on 30 Oct 2001, 4:00 a.m.,
in response to message #3 by Paul Kobayashi

Congratulation Paul!

My solution was: 0 ENTER CMPLX+

I'm amazed how easily you found it ...

Jean-Francois

      
Re: HP32S/SII micro challenge
Message #8 Posted by Andre' Wilhelmus on 30 Oct 2001, 3:30 a.m.,
in response to message #1 by J-F Garnier

CMPLXx^2:

0 ENTER 2 CMPLX y^x


[ Return to Index | Top of Index ]

Go back to the main exhibit hall