10C Gamma and other holiday surprises. - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: 10C Gamma and other holiday surprises. (/thread-145337.html) 10C Gamma and other holiday surprises. - Egan Ford - 01-03-2009 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. - Allen - 01-03-2009 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. - Gerson W. Barbosa - 01-03-2009 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. - V-PN - 01-03-2009 ```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. - Gerson W. Barbosa - 01-03-2009 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. - Egan Ford - 01-04-2009 Thanks and my daughter thanks you as well. Re: 10C Gamma and other holiday surprises. - Egan Ford - 01-04-2009 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. - Egan Ford - 01-04-2009 Quote: ```Why so negative... ``` If you change "03 +" to "03 -" then you get the proper Gamma results. :-) Re: 10C Gamma and other holiday surprises. - Gerson W. Barbosa - 01-05-2009 Very nice and one step shorter! But of course I prefer your original 12C and 10C programs. Thanks for making them available! Gerson.