10C Gamma and other holiday surprises.



#3

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.


#4

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!


#5

Thanks and my daughter thanks you as well.

#6

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.


#7

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.



#8

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.

#9

Quote:
Why so negative...

If you change "03 +" to "03 -" then you get the proper Gamma results. :-)
#10

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.


#11

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

Gerson.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP-10C Series Family Photo Max Stone 5 2,265 10-24-2013, 10:31 PM
Last Post: Eddie W. Shore
  HP15c continued fraction for Ln(Gamma) Tom Grydeland 0 1,146 09-30-2013, 05:48 AM
Last Post: Tom Grydeland
  HP Prime emulator: Gamma function Stephan Matthys 28 8,231 08-21-2013, 04:52 PM
Last Post: Namir
  What is the Gamma approximation you use? Namir 21 5,527 08-05-2013, 07:14 AM
Last Post: Namir
  10C, 11C, 12C logos on The Auction Site Peter Murphy (Livermore) 0 1,012 06-14-2013, 11:24 PM
Last Post: Peter Murphy (Livermore)
  SandMath routine of the week: Inverse Gamma Function Ángel Martin 39 9,814 03-24-2013, 08:19 AM
Last Post: peacecalc
  SpeedUI: Version 12.05 Holiday Edition released:-) Raymond Del Tondo 3 1,697 12-30-2012, 02:18 AM
Last Post: Han
  [wp34s] Incomplete Gamma on the wp34s Les Wright 18 5,348 12-06-2011, 11:07 AM
Last Post: Namir
  Fixing the bezel on a 10C Keith Midson 8 2,494 09-03-2011, 05:00 PM
Last Post: Dan W
  A Most Unusual Number, on the 10c/11c/12c/15c Katie Wasserman 8 2,510 07-15-2010, 03:53 AM
Last Post: Katie Wasserman

Forum Jump: