for the HP 32sII
Frac - Fractional approximation

Input
Resources to be used
Output

Program list (Rev.1.08 Nov. 5 2009)
Fractional approximation using
simple continued fraction
recompose and
calculate error
F01 LBL F   CK=A4E5 016.5
F02 CF 0
F03 ABS
F04 STO X
F05 STO Y
F06 102
F07 100
F08 ÷
F09 STO i
F10 CLχ
F11 χ<>y
B01 LBL B   CK=4498 022.5
B02 IP
B03 STO (i)
B04 χ≠0?
B05 XEQ C
B06 RCL Y
B07 RCL-(i)
B08 χ=0?
B09 SF 0
B10 FS? 0
B11 GTO E
B12 1/χ
B13 STO Y
B14 ISG i
B15 GTO B
E01 LBL E   CK=9F32 013.5
E02 CF 0
E03 R↓
E04 RCL X
E05 ABS
E06 CLχ
E07 LASTχ
E08 R↓
E09 RTN
C01 LBL C   CK=83CE 010.5
C02 RCL i
C03 IP
C04 &chi<>  i
C05 STO Z
C06 0
C07 1
D01 LBL D   CK=645E 053.0
D02 ENTER
D03 ENTER
D04 RCL (i)
D05 ×
D06 R↑
D07 +
D08 DSE i
D09 GTO D
D10 ABS
D11 χ<>y
D12 ENTER
D13 ENTER
D14 LASTχ
D15 ÷
D16 RCL× X
D17 1
D18 -
D19 χ<> Z
D20 STO i
D21 CLχ
D22 2.E~12
D23 RCL Z
D24 ABS
D25 χ<y?
D26 SF 0
D27 R↑
D28 R↑
D29 PSE
D30 RTN
Examples
Operation: π XEQ F

Fractional approximations
Order 0 1 2 3 4 5 6 7 8
y 322333355103,993104,348208,341312,689833,719
x 1 7106113 33,102 33,215 66,317 99,532265,381

Coefficients
A B C D E F G H I
3 7 15 1 292 1 1 1 2

Note: Simple continued fraction expression of π, to 12 digits accuracy.

SEE ALSO
Franctional approximation of π Japanese
Fractional approximation program for the HP-15C
Fractional approximation program for the HP-35S
Fractional approximation program for the HP-42S
Find the nearest fraction in the E24 numbers

www.finetune.co.jp [Mail] Copyright (c) HOSODA Takayuki. All rights reserved.
Powered by
 Finetune