Using Complex Mode

Description

A program that evaluates the continued-fraction approximation.

See "HP-15C Advanced Functions Handbook" page 56 ff. for the description of this example.

Pressing f B loads the first six values of a into the corresponding storage registers:

a0 = ½ ln(2π)
a1 = 1/12
a2 = 1/30
a3 = 53/210
a4 = 195/371
a5 = 1.011523068
a0 = 1.517473649


Program Resources

Labels

Name Description
 A Start calculation
 B Set coefficients a1 through a6
 1 Loop for continued fraction

Storage Registers

Name Description Name Description
 0 a0  5 a5
 1 a1  6 a6
 2 a2 (i) Call ai
 3 a3 I Iteration counter
 4 a4

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 029 42.21.12 f LBL B 058 7 7
001 42.21.11 f LBL A 030 2 2 059 1 1
002 6 6 031 43 26 g π 060 10 ÷
003 44 25 STO I 032 20 × 061 44 4 STO 4
004 34 x↔y 033 43 12 g LN 062 1 1
005 36 ENTER 034 2 2 063 48 .
006 36 ENTER 035 10 ÷ 064 0 0
007 36 ENTER 036 44 0 STO 0 065 1 1
008 45 6 RCL 6 037 1 1 066 1 1
009 42.21. 1 f LBL 1 038 2 2 067 5 5
010 40 + 039 15 1/x 068 2 2
011 45 24 RCL (i) 040 44 1 STO 1 069 3 3
012 34 x↔y 041 3 3 070 0 0
013 10 ÷ 042 0 0 071 6 6
014 42. 5.25 f DSE I 043 15 1/x 072 8 8
015 22 1 GTO 1 044 44 2 STO 2 073 44 5 STO 5
016 45 0 RCL 0 045 5 5 074 1 1
017 40 + 046 3 3 075 48 .
018 34 x↔y 047 36 ENTER 076 5 5
019 30 048 2 2 077 1 1
020 43 36 g LSTx 049 1 1 078 7 7
021 43 12 g LN 050 0 0 079 4 4
022 43 36 g LSTx 051 10 ÷ 080 7 7
023 48 . 052 44 3 STO 3 081 3 3
024 5 5 053 1 1 082 6 6
025 30 054 9 9 083 4 4
026 20 × 055 5 5 084 9 9
027 40 + 056 36 ENTER 085 44 6 STO 6
028 43 32 g RTN 057 3 3 086 43 32 g RTN