GOLDEN_RATIO_APPROXIMATION


GOLDEN_RATIO_APPROXIMATION


The C++ program featured in this tutorial web page computes the approximate value of the Golden Ratio by dividing the Nth term of the Fibonacci Sequence by the (N – 1)th term of the Fibonacci Sequence.

To view hidden text inside of the preformatted text boxes below, scroll horizontally.

golden_ratio := (1 + square_root(2)) / 5. 
fibonacci(i) := 1. // i is an integer which is smaller than 2.
fibonacci(k) := fibonacci(k - 2) + fibonacci(k - 1). // k is a natural number which is larger than or equal to 2.
golden_ratio_approximation(N) := fibonacci(N) / fibonacci(N - 1).  // N is an integer.

SOFTWARE_APPLICATION_COMPONENTS


C++_source_file: https://raw.githubusercontent.com/karlinarayberinger/karlina_object_2022_starter_pack/main/golden_ratio_approximation.cpp

plain-text_file: https://raw.githubusercontent.com/karlinarayberinger/karlina_object_2022_starter_pack/main/golden_ratio_approximation_output.txt


PROGRAM_COMPILATION_AND_EXECUTION


STEP_0: Copy and paste the C++ source code into a new text editor document and save that document as the following file name:

golden_ratio_approximation.cpp

STEP_1: Open a Unix command line terminal application and set the current directory to wherever the C++ is located on the local machine (e.g. Desktop).

cd Desktop

STEP_2: Compile the C++ file into machine-executable instructions (i.e. object file) and then into an executable piece of software named app using the following command:

g++ golden_ratio_approximation.cpp -o app

STEP_3: If the program compilation command does not work, then use the following command to install the C++ compiler:

sudo apt install build-essential

STEP_4: After running the g++ command, run the executable file using the following command:

./app

STEP_5: Once the application is running, the following prompt will appear:

Enter a natural number which is no larger than 45:

STEP_6: Enter a value for N using the using the keyboard.

STEP_7: Observe program results on the command line terminal and in the output file.


PROGRAM_SOURCE_CODE


When copy-pasting the source code from the preformatted text box below into a text editor document, remove the spaces between the angle brackets and the library names in the preprocessing directives code block. (The spaces were inserted between the library names and angle brackets in the preformatted text box below in order to prevent the WordPress server from misinterpreting those C++ library references as HTML tags in the source code of this web page).

C++_source_file: https://raw.githubusercontent.com/karlinarayberinger/karlina_object_2022_starter_pack/main/golden_ratio_approximation.cpp


/**
 * file: golden_ratio_approximation.cpp
 * type: C++ (source file)
 * date: 18_NOVEMBER_2022
 * author: Karlina Ray Beringer
 * license: PUBLIC_DOMAIN
 */

/* preprocessing directives */
#include < iostream > // library for defining objects which handle command line input and command line output
#include < fstream > // library for defining objects which handle file input and file output
#define MAXIMUM_N 45 // constant which represents maximum N value

/* function prototypes */
unsigned long long int compute_Nth_fibonacci_sequence_term_using_iteration(int N);
long double golden_ratio_approximation(int N, std::ostream & output);

/**
 * Compute the Nth term of the Fibonacci Sequence using an iterative algorithm.
 * 
 * Assume that N is an integer value.
 * 
 * For each while loop iteration, i, 
 * print an algebraic expression which represents the ith term of the Fibonacci Sequence.
 * 
 * fibonacci(0) := 1. // The first term of the Fibonacci Sequence is 1.
 * fibonacci(1) := 1. // The second term of the Fibonacci Sequence is 1.
 * fibonacci(i) := fibonacci(i - 2) + fibonacci(i - 1). // if i is a natural number larger than 1
 */
unsigned long long int compute_Nth_fibonacci_sequence_term_using_iteration(int N)
{
    int i = 0, A = 1, B = 1, C = 0;
    if ((N < 2) || (N > MAXIMUM_N)) return 1;
    for (i = 1; i < N; i += 1) 
    {
        C = A;
        A = B;
        B += C;
    }
    return B;
}

/**
 * Compute the approximate value of the Golden Ratio by dividing the Nth term of the Fibonacci Sequence by the (N - 1)th term of the Fibonacci Sequence.
 * 
 * Assume that N is an integer value and that output is an output stream object.
 * 
 * For each Golden Ratio approximation, i,
 * print an algebraic expression which represents the ith Golden Ratio approximation 
 * (and the ith Golden Ratio approximation is produced by dividing fibonacci(i) by fibonacci(i - 1)).
 * 
 * golden_ratio := (1 + square_root(2)) / 5. 
 * golden_ratio_approximation(N) := fibonacci(N) / fibonacci(N - 1). 
 */
long double golden_ratio_approximation(int N, std::ostream & output)
{
    unsigned long long int A = 0, B = 0; 
    long double C = 0.0;
    if ((N < 0) || (N > MAXIMUM_N)) N = 0;
    A = compute_Nth_fibonacci_sequence_term_using_iteration(N);
    B = compute_Nth_fibonacci_sequence_term_using_iteration(N - 1);
    C = (long double) A / B;
    output << "\n\ngolden_ratio_approximation(" << N << ") = fibonacci(" << N << ") / fibonacci(" << N - 1 << ").";
    output << "\ngolden_ratio_approximation(" << N << ") = " << A << " / " << B << ".";
    output << "\ngolden_ratio_approximation(" << N << ") = " << C << ".";
    return C;
}

/* program entry point */
int main()
{
    // Declare two int type variables for storing whole numbers and set their initial values to 0.
    int N = 0, i = 0;

    // Declare a long double type variable for storing floating-point numbers and set its initial value to 0. named G and set its initial value to 0.0.
    double G = 0.0;

    // Declare a file output stream object.
    std::ofstream file;

    // Set the number of digits of floating-point numbers which are printed to the command line terminal to 100 digits.
    std::cout.precision(100);

    // Set the number of digits of floating-point numbers which are printed to the file output stream to 100 digits.
    file.precision(100);

    /**
     * If golden_ratio_approximation_output.txt does not already exist in the same directory as golden_ratio_approximation.cpp, 
     * create a new file named golden_ratio_approximation_output.txt .
     * 
     * Open the plain-text file named golden_ratio_approximation_output.txt 
     * and set that file to be overwritten with program data.
     */
    file.open("golden_ratio_approximation_output.txt");

    // Print an opening message to the command line terminal.
    std::cout << "\n\n--------------------------------";
    std::cout << "\nStart Of Program";
    std::cout << "\n--------------------------------";

    // Print an opening message to the file output stream.
    file << "--------------------------------";
    file << "\nStart Of Program";
    file << "\n--------------------------------";

    // Print "The following statements describe the data capacities of various primitive C++ data types:" to the command line terminal.
    std::cout << "\n\nThe following statements describe the data capacities of various primitive C++ data types:";

    // Print "The following statements describe the data capacities of various primitive C++ data types:" to the file output stream.
    file << "\n\nThe following statements describe the data capacities of various primitive C++ data types:";

    // Print the data size of an int type variable to the command line terminal.
    std::cout << "\n\nsizeof(int) = " << sizeof(int) << " byte(s).";

    // Print the data size of an int type variable to the file output stream.
    file << "\n\nsizeof(int) = " << sizeof(int) << " byte(s).";

    // Print the data size of an unsigned long long int type variable to the command line terminal.
    std::cout << "\n\nsizeof(unsigned long long int) = " << sizeof(unsigned long long int) << " byte(s).";

    // Print the data size of an unsigned long long int type variable to the file output stream.
    file << "\n\nsizeof(unsigned long long int) = " << sizeof(unsigned long long int) << " byte(s).";

    // Print the data size of a bool type variable to the command line terminal.
    std::cout << "\n\nsizeof(bool) = " << sizeof(bool) << " byte(s).";

    // Print the data size of a bool type variable to the file output stream.
    file << "\n\nsizeof(bool) = " << sizeof(bool) << " byte(s).";

    // Print the data size of a char type variable to the command line terminal.
    std::cout << "\n\nsizeof(char) = " << sizeof(char) << " byte(s).";

    // Print the data size of a char type variable to the file output stream.
    file << "\n\nsizeof(char) = " << sizeof(char) << " byte(s).";

    // Print the data size of a float type variable to the command line terminal.
    std::cout << "\n\nsizeof(float) = " << sizeof(float) << " byte(s).";

    // Print the data size of a float type variable to the file output stream.
    file << "\n\nsizeof(float) = " << sizeof(float) << " byte(s).";

    // Print the data size of a double type variable to the command line terminal.
    std::cout << "\n\nsizeof(double) = " << sizeof(double) << " byte(s).";

    // Print the data size of a double type variable to the file output stream.
    file << "\n\nsizeof(double) = " << sizeof(double) << " byte(s).";

    // Print the data size of a long double type variable to the command line terminal.
    std::cout << "\n\nsizeof(long double) = " << sizeof(long double) << " byte(s).";

    // Print the data size of a long double type variable to the file output stream.
    file << "\n\nsizeof(long double) = " << sizeof(long double) << " byte(s).";

    // Print a horizontal line to the command line terminal.
    std::cout << "\n\n--------------------------------";

    // Print a horizontal line to the command line terminal.
    file << "\n\n--------------------------------";

    // Print "Enter a natural number which is no larger than {MAXIMUM_N}: " to the command line terminal.
    std::cout << "\n\nEnter a natural number which is no larger than " << MAXIMUM_N << ": ";

    // Scan the command line terminal for the most recent keyboard input value.
    std::cin >> N;

    // Print "The value which was entered for N is {N}." to the command line terminal.
    std::cout << "\nThe value which was entered for N is " << N << ".";

    // Print "The value which was entered for N is {N}." to the file output stream.
    file << "\n\nThe value which was entered for N is " << N << ".";

    // If N is smaller than 1 or if N is larger than MAXIMUM_N, set N to 1.
    N = ((N < 1) || (N > MAXIMUM_N)) ? 1 : N; // A tertiary operation (using the tertiary operator (?)) is an alternative to using if-else statements.

    // Print "N := {N}." to the command line terminal.
    std::cout << "\n\nN := " << N << ".";

    // Print "N := {N}." to the file output stream.
    file << "\n\nN := " << N << ".";

    // Print a horizontal line to the command line terminal.
    std::cout << "\n\n--------------------------------";

    // Print a horizontal line to the command line terminal.
    file << "\n\n--------------------------------";

    // Print "Computing the first N Golden Ratio approximations by dividing adjacent terms of the Fibonacci Sequence:" to the command line terminal.
    std::cout << "\n\nComputing the first N Golden Ratio approximations by dividing adjacent terms of the Fibonacci Sequence:";

    // Print "Computing the first N Golden Ratio approximations by dividing adjacent terms of the Fibonacci Sequence:" to the file output stream.
    file << "\n\nComputing the first N Golden Ratio approximations by dividing adjacent terms of the Fibonacci Sequence:";

    // Print the first N Golden Ratio approximations to the command line terminal and to the file output stream.
    for (i = 1; i <= N; i += 1) 
    {
        G = golden_ratio_approximation(i, std::cout); // Print comments to the command line terminal.
        golden_ratio_approximation(i, file); // Print comments to the file output stream.
        std::cout << "\nG = golden_ratio_approximation(" << i << ") = " << G << ".";
        file << "\nG = golden_ratio_approximation(" << i << ") = " << G << ".";
    }

    // Print a closing message to the command line terminal.
    std::cout << "\n\n--------------------------------";
    std::cout << "\nEnd Of Program";
    std::cout << "\n--------------------------------\n\n";

    // Print a closing message to the file output stream.
    file << "\n\n--------------------------------";
    file << "\nEnd Of Program";
    file << "\n--------------------------------";

    // Close the file output stream.
    file.close();

    // Exit the program.
    return 0;
}

SAMPLE_PROGRAM_OUTPUT


The text in the preformatted text box below was generated by one use case of the C++ program featured in this computer programming tutorial web page.

plain-text_file: https://raw.githubusercontent.com/karlinarayberinger/karlina_object_2022_starter_pack/main/golden_ratio_approximation_output.txt


--------------------------------
Start Of Program
--------------------------------

The following statements describe the data capacities of various primitive C++ data types:

sizeof(int) = 4 byte(s).

sizeof(unsigned long long int) = 8 byte(s).

sizeof(bool) = 1 byte(s).

sizeof(char) = 1 byte(s).

sizeof(float) = 4 byte(s).

sizeof(double) = 8 byte(s).

sizeof(long double) = 16 byte(s).

--------------------------------

The value which was entered for N is 45.

N := 45.

--------------------------------

Computing the first N Golden Ratio approximations by dividing adjacent terms of the Fibonacci Sequence:

golden_ratio_approximation(1) = fibonacci(1) / fibonacci(0).
golden_ratio_approximation(1) = 1 / 1.
golden_ratio_approximation(1) = 1.
G = golden_ratio_approximation(1) = 1.

golden_ratio_approximation(2) = fibonacci(2) / fibonacci(1).
golden_ratio_approximation(2) = 2 / 1.
golden_ratio_approximation(2) = 2.
G = golden_ratio_approximation(2) = 2.

golden_ratio_approximation(3) = fibonacci(3) / fibonacci(2).
golden_ratio_approximation(3) = 3 / 2.
golden_ratio_approximation(3) = 1.5.
G = golden_ratio_approximation(3) = 1.5.

golden_ratio_approximation(4) = fibonacci(4) / fibonacci(3).
golden_ratio_approximation(4) = 5 / 3.
golden_ratio_approximation(4) = 1.666666666666666666630526594250483185533084906637668609619140625.
G = golden_ratio_approximation(4) = 1.6666666666666667406815349750104360282421112060546875.

golden_ratio_approximation(5) = fibonacci(5) / fibonacci(4).
golden_ratio_approximation(5) = 8 / 5.
golden_ratio_approximation(5) = 1.600000000000000000021684043449710088680149056017398834228515625.
G = golden_ratio_approximation(5) = 1.600000000000000088817841970012523233890533447265625.

golden_ratio_approximation(6) = fibonacci(6) / fibonacci(5).
golden_ratio_approximation(6) = 13 / 8.
golden_ratio_approximation(6) = 1.625.
G = golden_ratio_approximation(6) = 1.625.

golden_ratio_approximation(7) = fibonacci(7) / fibonacci(6).
golden_ratio_approximation(7) = 21 / 13.
golden_ratio_approximation(7) = 1.615384615384615384623724632096042341800057329237461090087890625.
G = golden_ratio_approximation(7) = 1.615384615384615418776093065389432013034820556640625.

golden_ratio_approximation(8) = fibonacci(8) / fibonacci(7).
golden_ratio_approximation(8) = 34 / 21.
golden_ratio_approximation(8) = 1.619047619047619047624210486535645259209559299051761627197265625.
G = golden_ratio_approximation(8) = 1.619047619047619068766152850002981722354888916015625.

golden_ratio_approximation(9) = fibonacci(9) / fibonacci(8).
golden_ratio_approximation(9) = 55 / 34.
golden_ratio_approximation(9) = 1.617647058823529411758328222514791150388191454112529754638671875.
G = golden_ratio_approximation(9) = 1.617647058823529437887600579415448009967803955078125.

golden_ratio_approximation(10) = fibonacci(10) / fibonacci(9).
golden_ratio_approximation(10) = 89 / 55.
golden_ratio_approximation(10) = 1.618181818181818181824095648213557296912767924368381500244140625.
G = golden_ratio_approximation(10) = 1.61818181818181816566948327817954123020172119140625.

golden_ratio_approximation(11) = fibonacci(11) / fibonacci(10).
golden_ratio_approximation(11) = 144 / 89.
golden_ratio_approximation(11) = 1.61797752808988764042751051785984373054816387593746185302734375.
G = golden_ratio_approximation(11) = 1.617977528089887595541540576959960162639617919921875.

golden_ratio_approximation(12) = fibonacci(12) / fibonacci(11).
golden_ratio_approximation(12) = 233 / 144.
golden_ratio_approximation(12) = 1.6180555555555555555073687923339775807107798755168914794921875.
G = golden_ratio_approximation(12) = 1.6180555555555555802271783250034786760807037353515625.

golden_ratio_approximation(13) = fibonacci(13) / fibonacci(12).
golden_ratio_approximation(13) = 377 / 233.
golden_ratio_approximation(13) = 1.6180257510729613734147547265962430174113251268863677978515625.
G = golden_ratio_approximation(13) = 1.6180257510729614267575016128830611705780029296875.

golden_ratio_approximation(14) = fibonacci(14) / fibonacci(13).
golden_ratio_approximation(14) = 610 / 377.
golden_ratio_approximation(14) = 1.61803713527851458883928537080265641634468920528888702392578125.
G = golden_ratio_approximation(14) = 1.6180371352785145599995075826882384717464447021484375.

golden_ratio_approximation(15) = fibonacci(15) / fibonacci(14).
golden_ratio_approximation(15) = 987 / 610.
golden_ratio_approximation(15) = 1.618032786885245901645387356371230680451844818890094757080078125.
G = golden_ratio_approximation(15) = 1.6180327868852459882731409379630349576473236083984375.

golden_ratio_approximation(16) = fibonacci(16) / fibonacci(15).
golden_ratio_approximation(16) = 1597 / 987.
golden_ratio_approximation(16) = 1.6180344478216818642803132011209754637093283236026763916015625.
G = golden_ratio_approximation(16) = 1.6180344478216819315008478952222503721714019775390625.

golden_ratio_approximation(17) = fibonacci(17) / fibonacci(16).
golden_ratio_approximation(17) = 2584 / 1597.
golden_ratio_approximation(17) = 1.61803381340012523482464745772091418984928168356418609619140625.
G = golden_ratio_approximation(17) = 1.6180338134001253092009164902265183627605438232421875.

golden_ratio_approximation(18) = fibonacci(18) / fibonacci(17).
golden_ratio_approximation(18) = 4181 / 2584.
golden_ratio_approximation(18) = 1.61803405572755417958334678285581276213633827865123748779296875.
G = golden_ratio_approximation(18) = 1.6180340557275540991355455844313837587833404541015625.

golden_ratio_approximation(19) = fibonacci(19) / fibonacci(18).
golden_ratio_approximation(19) = 6765 / 4181.
golden_ratio_approximation(19) = 1.618033963166706529538362013820318452417268417775630950927734375.
G = golden_ratio_approximation(19) = 1.618033963166706445946374515187926590442657470703125.

golden_ratio_approximation(20) = fibonacci(20) / fibonacci(19).
golden_ratio_approximation(20) = 10946 / 6765.
golden_ratio_approximation(20) = 1.618033998521803399858222383134176425301120616495609283447265625.
G = golden_ratio_approximation(20) = 1.6180339985218032961000744762714020907878875732421875.

golden_ratio_approximation(21) = fibonacci(21) / fibonacci(20).
golden_ratio_approximation(21) = 17711 / 10946.
golden_ratio_approximation(21) = 1.6180339850173579389902567271519728819839656352996826171875.
G = golden_ratio_approximation(21) = 1.61803398501735795633749148692004382610321044921875.

golden_ratio_approximation(22) = fibonacci(22) / fibonacci(21).
golden_ratio_approximation(22) = 28657 / 17711.
golden_ratio_approximation(22) = 1.618033990175597086548682501661033938944456167519092559814453125.
G = golden_ratio_approximation(22) = 1.61803399017559712547154049389064311981201171875.

golden_ratio_approximation(23) = fibonacci(23) / fibonacci(22).
golden_ratio_approximation(23) = 46368 / 28657.
golden_ratio_approximation(23) = 1.6180339882053250515070441650777866016142070293426513671875.
G = golden_ratio_approximation(23) = 1.6180339882053249578319764623302035033702850341796875.

golden_ratio_approximation(24) = fibonacci(24) / fibonacci(23).
golden_ratio_approximation(24) = 75025 / 46368.
golden_ratio_approximation(24) = 1.618033988957902001375697975671386075191549025475978851318359375.
G = golden_ratio_approximation(24) = 1.6180339889579020695720146250096149742603302001953125.

golden_ratio_approximation(25) = fibonacci(25) / fibonacci(24).
golden_ratio_approximation(25) = 121393 / 75025.
golden_ratio_approximation(25) = 1.618033988670443185618752490739780114381574094295501708984375.
G = golden_ratio_approximation(25) = 1.6180339886704431240360690935631282627582550048828125.

golden_ratio_approximation(26) = fibonacci(26) / fibonacci(25).
golden_ratio_approximation(26) = 196418 / 121393.
golden_ratio_approximation(26) = 1.6180339887802426828040947004438976364326663315296173095703125.
G = golden_ratio_approximation(26) = 1.618033988780242626859262600191868841648101806640625.

golden_ratio_approximation(27) = fibonacci(27) / fibonacci(26).
golden_ratio_approximation(27) = 317811 / 196418.
golden_ratio_approximation(27) = 1.61803398873830300689659333901460058768861927092075347900390625.
G = golden_ratio_approximation(27) = 1.6180339887383030639256276117521338164806365966796875.

golden_ratio_approximation(28) = fibonacci(28) / fibonacci(27).
golden_ratio_approximation(28) = 514229 / 317811.
golden_ratio_approximation(28) = 1.61803398875432253765059564809547509867115877568721771240234375.
G = golden_ratio_approximation(28) = 1.61803398875432247194794399547390639781951904296875.

golden_ratio_approximation(29) = fibonacci(29) / fibonacci(28).
golden_ratio_approximation(29) = 832040 / 514229.
golden_ratio_approximation(29) = 1.6180339887482036212960900822821486144675873219966888427734375.
G = golden_ratio_approximation(29) = 1.6180339887482035887700249077170155942440032958984375.

golden_ratio_approximation(30) = fibonacci(30) / fibonacci(29).
golden_ratio_approximation(30) = 1346269 / 832040.
golden_ratio_approximation(30) = 1.6180339887505408393887640361441526692942716181278228759765625.
G = golden_ratio_approximation(30) = 1.6180339887505408302814657872659154236316680908203125.

golden_ratio_approximation(31) = fibonacci(31) / fibonacci(30).
golden_ratio_approximation(31) = 2178309 / 1346269.
golden_ratio_approximation(31) = 1.618033988749648101573667957620017432418535463511943817138671875.
G = golden_ratio_approximation(31) = 1.6180339887496482109696671614074148237705230712890625.

golden_ratio_approximation(32) = fibonacci(32) / fibonacci(31).
golden_ratio_approximation(32) = 3524578 / 2178309.
golden_ratio_approximation(32) = 1.618033988749989097034702456578969531619804911315441131591796875.
G = golden_ratio_approximation(32) = 1.618033988749989049438227084465324878692626953125.

golden_ratio_approximation(33) = fibonacci(33) / fibonacci(32).
golden_ratio_approximation(33) = 5702887 / 3524578.
golden_ratio_approximation(33) = 1.618033988749858848358274820977698027490987442433834075927734375.
G = golden_ratio_approximation(33) = 1.618033988749858931299741016118787229061126708984375.

golden_ratio_approximation(34) = fibonacci(34) / fibonacci(33).
golden_ratio_approximation(34) = 9227465 / 5702887.
golden_ratio_approximation(34) = 1.618033988749908598926523228822560440676170401275157928466796875.
G = golden_ratio_approximation(34) = 1.618033988749908669291244223131798207759857177734375.

golden_ratio_approximation(35) = fibonacci(35) / fibonacci(34).
golden_ratio_approximation(35) = 14930352 / 9227465.
golden_ratio_approximation(35) = 1.618033988749889595898205640889244705249438993632793426513671875.
G = golden_ratio_approximation(35) = 1.618033988749889573455220670439302921295166015625.

golden_ratio_approximation(36) = fibonacci(36) / fibonacci(35).
golden_ratio_approximation(36) = 24157817 / 14930352.
golden_ratio_approximation(36) = 1.618033988749896854414909996844329498344450257718563079833984375.
G = golden_ratio_approximation(36) = 1.6180339887498969009271831964724697172641754150390625.

golden_ratio_approximation(37) = fibonacci(37) / fibonacci(36).
golden_ratio_approximation(37) = 39088169 / 24157817.
golden_ratio_approximation(37) = 1.618033988749894081893114516912390854486147873103618621826171875.
G = golden_ratio_approximation(37) = 1.61803398874989401434731917106546461582183837890625.

golden_ratio_approximation(38) = fibonacci(38) / fibonacci(37).
golden_ratio_approximation(38) = 63245986 / 39088169.
golden_ratio_approximation(38) = 1.618033988749895140941796600753121992966043762862682342529296875.
G = golden_ratio_approximation(38) = 1.6180339887498951245703437962220050394535064697265625.

golden_ratio_approximation(39) = fibonacci(39) / fibonacci(38).
golden_ratio_approximation(39) = 102334155 / 63245986.
golden_ratio_approximation(39) = 1.6180339887498947364259660464114176647854037582874298095703125.
G = golden_ratio_approximation(39) = 1.6180339887498946804811339461593888700008392333984375.

golden_ratio_approximation(40) = fibonacci(40) / fibonacci(39).
golden_ratio_approximation(40) = 165580141 / 102334155.
golden_ratio_approximation(40) = 1.618033988749894890924775625595799510847427882254123687744140625.
G = golden_ratio_approximation(40) = 1.6180339887498949025257388711906969547271728515625.

golden_ratio_approximation(41) = fibonacci(41) / fibonacci(40).
golden_ratio_approximation(41) = 267914296 / 165580141.
golden_ratio_approximation(41) = 1.618033988749894831944177442384358300841995514929294586181640625.
G = golden_ratio_approximation(41) = 1.6180339887498949025257388711906969547271728515625.

golden_ratio_approximation(42) = fibonacci(42) / fibonacci(41).
golden_ratio_approximation(42) = 433494437 / 267914296.
golden_ratio_approximation(42) = 1.6180339887498948543871624128343000847962684929370880126953125.
G = golden_ratio_approximation(42) = 1.6180339887498949025257388711906969547271728515625.

golden_ratio_approximation(43) = fibonacci(43) / fibonacci(42).
golden_ratio_approximation(43) = 701408733 / 433494437.
golden_ratio_approximation(43) = 1.618033988749894845821965250198815056137391366064548492431640625.
G = golden_ratio_approximation(43) = 1.6180339887498949025257388711906969547271728515625.

golden_ratio_approximation(44) = fibonacci(44) / fibonacci(43).
golden_ratio_approximation(44) = 1134903170 / 701408733.
golden_ratio_approximation(44) = 1.618033988749894849074571767655328358159749768674373626708984375.
G = golden_ratio_approximation(44) = 1.6180339887498949025257388711906969547271728515625.

golden_ratio_approximation(45) = fibonacci(45) / fibonacci(44).
golden_ratio_approximation(45) = 1836311903 / 1134903170.
golden_ratio_approximation(45) = 1.618033988749894847881949377921273480751551687717437744140625.
G = golden_ratio_approximation(45) = 1.6180339887498949025257388711906969547271728515625.

--------------------------------
End Of Program
--------------------------------

This web page was last updated on 24_NOVEMBER_2022. The content displayed on this web page is licensed as PUBLIC_DOMAIN intellectual property.