A Tiny (WP34S) program does a lot
Post: #1
 BarryMead Senior Member Posts: 416 Joined: Feb 2014
A Tiny (WP34S) program does a lot
While looking at a graph of the "Factorial" Gamma(X+1) function I noticed that between the points 0 and 1 where the value of the function is 1 (one), the function dips below one. I was curious how to find the minimum value between these two points. Using SLV with the f'(x) function made it quite easy. This tiny program illustrates how powerful a small WP-34S program can be. It took only 15 program steps on the WP-34S and over 40 on the HP-15C.
Code:
 LBL A                //Entry point for the program # 000                //Lower search limit 0 # 001                //Upper search limit 1 SLV 00               //Find the zero point of the derivative RTN                  //Return if SLV succeeds ERR 20               //If SLV fails show "No root Found" LBL 00               //Function to find the first derivative f'(x) 01 RTN LBL 01               //Function to calculate the Factorial of value x! RTN LBL'[DELTA]X'        //Function to set the Delta X of derivative # 001 SDR 005              //Set Delta X to .00001 END

It takes a while to run on the real WP-34S (about 46 seconds), but is almost instantaneous on the emulator.
Obviously when a function reaches a "Minimum" value, its first derivative (slope) will be zero.
Since I don't know what the first derivative of the Factorial Gamma(X+1) looks like, I used the f'(x) function
to approximate it. Note: The Optional '[Delta]X' routine helps to improve the accuracy of the result.
And the answer is: 0.4616321449683623 where the factorial reaches it's minimum value of: 0.8856031944108887
Thanks to Paul Dale and Dieter for the excellent enhancements to the program.
 « Next Oldest | Next Newest »

 Messages In This Thread A Tiny (WP34S) program does a lot - BarryMead - 11-28-2014 03:16 PM RE: A Tiny (WP34S) program does a lot - Paul Dale - 11-28-2014, 10:05 PM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 12:39 AM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 06:42 AM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 10:06 AM RE: A Tiny (WP34S) program does a lot - Paul Dale - 11-29-2014, 11:03 AM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 11:37 AM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 09:15 PM RE: A Tiny (WP34S) program does a lot - Massimo Gnerucci - 11-29-2014, 09:21 PM RE: A Tiny (WP34S) program does a lot - Gerson W. Barbosa - 11-29-2014, 01:31 AM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 07:44 PM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 08:13 PM RE: A Tiny (WP34S) program does a lot - Thomas Klemm - 11-29-2014, 11:04 PM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 11:33 PM RE: A Tiny (WP34S) program does a lot - Marcus von Cube - 11-30-2014, 10:27 AM RE: A Tiny (WP34S) program does a lot - walter b - 11-29-2014, 08:18 PM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 08:41 PM RE: A Tiny (WP34S) program does a lot - walter b - 11-29-2014, 08:55 PM RE: A Tiny (WP34S) program does a lot - Gerson W. Barbosa - 11-29-2014, 09:58 PM RE: A Tiny (WP34S) program does a lot - Dieter - 11-28-2014, 10:29 PM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 12:34 AM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 06:35 AM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 01:06 AM RE: A Tiny (WP34S) program does a lot - BarryMead - 11-29-2014, 12:58 AM RE: A Tiny (WP34S) program does a lot - Gerson W. Barbosa - 11-29-2014, 01:55 AM RE: A Tiny (WP34S) program does a lot - Thomas Klemm - 11-29-2014, 10:27 AM RE: A Tiny (WP34S) program does a lot - Dieter - 11-29-2014, 09:02 PM RE: A Tiny (WP34S) program does a lot - Paul Dale - 11-29-2014, 09:31 PM RE: A Tiny (WP34S) program does a lot - Thomas Klemm - 11-30-2014, 11:26 AM RE: A Tiny (WP34S) program does a lot - Dieter - 11-30-2014, 12:36 PM RE: A Tiny (WP34S) program does a lot - Nigel (UK) - 11-30-2014, 01:14 PM RE: A Tiny (WP34S) program does a lot - Marcus von Cube - 11-30-2014, 02:59 PM RE: A Tiny (WP34S) program does a lot - Dieter - 11-30-2014, 03:17 PM

User(s) browsing this thread: 1 Guest(s)