(50g) Root with Euklidian Algorithm
|
04-22-2014, 09:09 AM
(This post was last modified: 05-03-2015 08:05 PM by peacecalc.)
Post: #1
|
|||
|
|||
(50g) Root with Euklidian Algorithm
Hello friends,
for educational purpose I used the hp 50g to approximate a root with a continued fraction. The main task of such a program is 1) to calculate integer part of the root, 2) the reciprocal of the non-integer part 3) find out the integer part of the expression in 2) 2) and 3) is repeated as long as you whish. I made three programs: anrat: splits every fraction in three parts: integer part, enumarator and denominator. anirr: with the help of "anrat" this program calculates one step 2) and 3) rooeu: the main program acts with "anirr", it calculates 1) and the repeated times of 2) and 3), last task is to display the continued fraction in the depth you wished, display the reduced fraction and the numerical value of the continued fraction. Enjoy! anrat: Input: fraction or integer Output: integer (level 3) denumerator (level 2) denominator (level 1) Code:
anirr: Input: root which has to be estimated (level 3) integer part of the root (level 2) the reciprocal value of (level 1) irrational rest of the root smaller 1 Output: root which has to be estimated (level 4) integer part of the root (level 3) the new reciprocal value of (level 2) irrational rest of the root, smaller 1 integer for continued fraction (level 1) Code:
rooeu: Input: root to estimate (level 2) depth of continued fraction (level 1) Output: numerical value of continued fraction (level 1) Code:
and some display screen shots: pic1: in- (level 4) and output from anrat pic2, 3 in- and output from anirr (here root from 52) pic4 input for rooeu (here root from 52 and iteration depth 6) pic5 first output: continued fraction pic6: second output reduced fraction pic7: numerical value anrat.bmp (Size: 128.31 KB / Downloads: 29) anirr_in.bmp (Size: 124.72 KB / Downloads: 22) anirr_out.bmp (Size: 125.35 KB / Downloads: 19) rooeu_in.bmp (Size: 125.35 KB / Downloads: 23) |
|||
04-22-2014, 09:10 AM
(This post was last modified: 04-22-2014 12:03 PM by peacecalc.)
Post: #2
|
|||
|
|||
RE: HP 50g Root with Euklidian Algorithm
.last three pics.
rooeu_out_1.bmp (Size: 123.8 KB / Downloads: 28) rooeu_out_2.bmp (Size: 126.12 KB / Downloads: 21) rooeu_out_3.bmp (Size: 124.58 KB / Downloads: 21) .. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)