Casio fx-3900P

Datasheet legend
Ab/c: Fractions calculation
AC: Alternating current
BaseN: Number base calculations
Card: Magnetic card storage
Cmem: Continuous memory
Cond: Conditional execution
Const: Scientific constants
Cplx: Complex number arithmetic
DC: Direct current
Eqlib: Equation library
Exp: Exponential/logarithmic functions
Fin: Financial functions
Grph: Graphing capability
Hyp: Hyperbolic functions
Ind: Indirect addressing
Intg: Numerical integration
Jump: Unconditional jump (GOTO)
Lbl: Program labels
LCD: Liquid Crystal Display
LED: Light-Emitting Diode
Li-ion: Lithium-ion rechargeable battery
Lreg: Linear regression (2-variable statistics)
mA: Milliamperes of current
Mtrx: Matrix support
NiCd: Nickel-Cadmium rechargeable battery
NiMH: Nickel-metal-hydrite rechargeable battery
Prnt: Printer
RTC: Real-time clock
Sdev: Standard deviation (1-variable statistics)
Solv: Equation solver
Subr: Subroutine call capability
Symb: Symbolic computing
Tape: Magnetic tape storage
Trig: Trigonometric functions
Units: Unit conversions
VAC: Volts AC
VDC: Volts DC
Years of production: 1986  Display type: Alphanumeric display  
New price:   Display color: Black  
    Display technology: Liquid crystal display 
Size: 5½"×3"×½" Display size: 16 characters and 3 digits
Weight: 4 oz    
    Entry method: Formula entry 
Batteries: 1×"CR-2025" Lithium Advanced functions: Trig Exp Hyp Lreg Cplx Cmem BaseN 
External power:   Memory functions:  
    Programming model: Formula programming 
Precision: 12 digits Program functions: Jump Cond Subr Lbl  
Memories: 6 numbers Program display: Formula display  
Program memory: 100 program steps Program editing: Formula entry  
Chipset:   Forensic result: 9.00001568547  

fx3900p.jpg (26866 bytes)A bit less sophisticated than its advanced counterpart, the fx-4000P, the fx-3900P is nevertheless a capable programmable scientific calculator. Its 100-step program memory is a bit cramped, but its programming model is comprehensive, and it features the same full compliment of scientific functions as the fx-4000P.

Limited program memory means that the programmer needs to be innovative. For instance, if you wish to compute the Gamma function, an algorithm requiring a lot of constants will not do; constants take up memory, either in the form of program steps or using up number registers. Fortunately, I recently received an e-mail from Robert H. Windschitl who wrote about a compact approximation of Stirling's formula. With his algorithm, the following 100-step program computes the logarithm of the Gamma function to 9+ digits of accuracy across its entire domain, including negative arguments for which the function is defined. (Negative arguments require that you first place the calculator in radians mode in order to get the correct result.)

Abs A→B:
Lbl 1:
9>B⇒Goto 1:
(ln (Bsinh B-1+1÷810÷B²²÷B²)÷2+ln B-1)B+ln (2π÷B)÷2-ln C→C:
0>A⇒ln (-π/A/sin πA)-C->C: