Write a program that tries to determine whether or not using the
formula to compute the nth Fibonacci number works properly on a computer.
Your goal is to identify the smallest number for which it does not work properly.
You can start by using the iterative algorithm from the Recursive Functions example.
Then implement a method that computes the nth Fibonacci number using the closed form expression we developed in class. You can find the formula here: Fibonacci number (Wikipedia). Do not use an approximation
in your algorithm. Instead, compute it using the appropriate Java functions (e.g. Math.sqrt).
The easiest way to proceed is probably to compute the first 15 or so with each method and compare them. Your program should output 3 values per line: n, and the two values of f(n) as computed by your two methods.
If they differ at any point, you have succeeded. If they don't, try some larger values. You might want to replace the ints with longs in the original code so you can compute slightly larger values (I think you can compute up to the 16th or 17th with 32 bits).
Print out your code along with the output of running both versions on data from 1 to 15 or so (at least until you find if/when the two methods differ).