Post Reply 
(12C) Stirling's approximation
10-24-2017, 05:35 AM (This post was last modified: 10-24-2017 09:15 AM by Gamo.)
Post: #1
(12C) Stirling's approximation
For when you need answer from Decimal Factorial with your HP 12C

From Wikipedia:
In mathematics, Stirling's approximation (or Stirling's formula) is an approximation for factorials. It is a good-quality approximation, leading to accurate results even for small values of n.

Program:
Code:

571
ENTER
2488320
/
CHS
STO 1
139
ENTER
51840
/
CHS
STO 2
288
1/x
STO 3
12
1/x
STO 4
CLx
R/S
ENTER
STO 5
2
x
355
ENTER
113
/
x
Sqr
RCL 5
RCL 5
2
/
Y^x
STO 6
x
RCL 5
e^x
1/x
x
RCL 6
x
STO 7
RCL 5
1/x
ENTER
ENTER
ENTER
RCL 1
x
RCL 2
+
x
RCL 3
+
x
RCL 4
+
x
1
+
RCL 7
x
GTO 37

Example: Clear Register f [REG]

[R/S] result 0 (Initialize)

2.34! ------> 2.34 [R/S] result 2.7976......
4.32! ------> 4.32 [R/S] result 39.2945....
5.43! ------> 5.43 [R/S] result 254.0337...


Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Stirling's approximation - Gamo - 10-24-2017 05:35 AM
RE: (12C) Stirling's approximation - Gamo - 11-04-2017, 05:26 AM
RE: (12C) Stirling's approximation - Gamo - 11-05-2017, 07:39 AM



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