The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

10C Gamma and other holiday surprises.
Message #1 Posted by Egan Ford on 3 Jan 2009, 4:18 p.m.

At home I keep my math and calculator hobbies mostly to myself. My wife and kid are aware of my hobbies, but do not share in them. You can then imagine my surprise when I received a very nice 10C in box with manual, registration card, etc... for Xmas this year. My lovely wife independently determined after secretly inventorying my collection that I needed a 10C. Wow!

Programmatically the 10C is very limited compared to other Voyagers--even the 12C. There is a 79 step limit that will never be reached with most programs because it exhausts all of the registers.

As my first self-challenge I ported my 12C Gamma function (http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=100275, Message #6):

01  X^2         13  *           25  RCL 0       37  8           49  PI          
02  SQRT        14  SQRT        26  6           38  RCL 1       50  *           
03  STO 1       15  *           27  *           39  +           51  ENTER       
04  8           16  4           28  +           40  STO/ 0      52  SIN         
05  +           17  RCL 0       29  2           41  1           53  RCL 0       
06  STO 0       18  *           30  *           42  -           54  *           
07  ENTER       19  1/X         31  1/X         43  RCL 1       55  /           
08  Y^X         20  RCL 0       32  RCL 0       44  X<>Y        56  STO 1       
09  PI          21  +           33  -           45  X<=Y?       57  RCL 0       
10  RCL 0       22  5           34  E^X         46  GTO 48      58  GTO 00      
11  *           23  *           35  *           47  GTO 40      
12  2           24  1/X         36  STO 0       48  RCL 1       
It needs a bit of work, but for now just enter any positive or negative decimal number, then press R/S. The results will be stored in registers 0 and 1:
RCL 0 = Gamma(|x|)
RCL 1 = Gamma(-|x|)
IOW, if you entered a negative number use RCL 1 for your result.

NOTE: Read the 12C link above on the implementation details. Also note that this Gamma is really Gamma(x)=(x-1)! just like the 15C.

But wait, there's more... For Xmas my 17-year-old daughter-artist painted on 24" canvas her interpretation of a calculator:

Calculators by Dhemerae Ford

Wow-Wee!

Edited: 3 Jan 2009, 4:21 p.m.

      
Re: 10C Gamma and other holiday surprises.
Message #2 Posted by Allen on 3 Jan 2009, 4:54 p.m.,
in response to message #1 by Egan Ford

Very impressive, Egan. I am always impressed by your programming skills. I do not know of a more versatile programmer than you, and with your thoughtful wife and artful daughter, you have now three things to be very proud of. (FWIW I think Dhemerae's picture is extremely impressive for any age.. excellent mix of old and new,and fitting color scheme since it matches the box designs of the HP-10C .)

Happy new year to you!

            
Re: 10C Gamma and other holiday surprises.
Message #3 Posted by Egan Ford on 4 Jan 2009, 12:41 p.m.,
in response to message #2 by Allen

Thanks and my daughter thanks you as well.

      
Re: 10C Gamma and other holiday surprises.
Message #4 Posted by Gerson W. Barbosa on 3 Jan 2009, 5:00 p.m.,
in response to message #1 by Egan Ford

Congratulations for your new 10C, the nice painting and the 12C Gamma porting!

Now, since you appear to be in the mood, try porting the related 12C program below to the 10C:

01 .		17 5
02 5            18 4
03 +            19 0
04 n!           20 0
05 2            21 0
06 ENTER        22 5
07 ENTER        23 ENTER
08 LASTx        24 3
09 *            25 4
10 y^x          26 1/x
11 LASTx        27 y^x
12 n!           28 ENTER
13 x<>y         29 y^x
14 /            30 *
15 x<>y         31 GTO 00
16 /

I guess you'll need only 20 steps on the 10C. You might want to change the third step:

03 -

Gerson.

            
Re: 10C Gamma and other holiday surprises.
Message #5 Posted by V-PN on 3 Jan 2009, 7:12 p.m.,
in response to message #4 by Gerson W. Barbosa

Why so negative...
Quote:
I guess you'll need only 20 steps on the 10C. You might want to change the third step:

03 -

Gerson.


                  
Re: 10C Gamma and other holiday surprises.
Message #6 Posted by Gerson W. Barbosa on 3 Jan 2009, 9:30 p.m.,
in response to message #5 by V-PN

Quote:
Why so negative...

Ok, "let's have a positive attitude" and keep it unchanged. I just had overlooked Egan Ford's statement "Also note that this Gamma is really Gamma(x)=(x-1)! just like the 15C."

Gerson.

                  
Re: 10C Gamma and other holiday surprises.
Message #7 Posted by Egan Ford on 4 Jan 2009, 1:12 p.m.,
in response to message #5 by V-PN

Quote:
Why so negative...

If you change "03 +" to "03 -" then you get the proper Gamma results. :-)
            
Re: 10C Gamma and other holiday surprises.
Message #8 Posted by Egan Ford on 4 Jan 2009, 1:08 p.m.,
in response to message #4 by Gerson W. Barbosa

Here you go, 10C Gamma(x + 1/2), x is an integer: 0 <= x < 34:

01  .         10  2         
02  5         11  x<>y      
03  +         12  y^x       
04  n!        13  /         
05  LASTx     14  x<>y      
06  2         15  /         
07  *         16  PI        
08  n!        17  SQRT      
09  LASTx     18  *         
Like your version above the input is limited to integers (0 <= x < 34) + 1/2, i.e. 0.5, 1.5, 2.5, ... 33.5. This makes sense because (34.5 + .5) * 2 = 70, and n! is limited to 69! on all Voyagers.

My original 10C version is approximately limited to real numbers -48 < x <= 48 where x != integers <= 0. If I had more instructions I could check for negative integers and return 9.9999999E99 like the 15C does (sans the blinking) and just use n! for integers >= 0.

The built-in 15C version is approximately limited to real numbers -69 < x <= 69.

Edited: 4 Jan 2009, 1:14 p.m.

                  
Re: 10C Gamma and other holiday surprises.
Message #9 Posted by Gerson W. Barbosa on 5 Jan 2009, 9:57 a.m.,
in response to message #8 by Egan Ford

Very nice and one step shorter! But of course I prefer your original 12C and 10C programs. Thanks for making them available!

Gerson.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall