The State of the Art
The current best algorithm for computing can be summarized succinctly using the following three equations:
We can use these three equations to chain our way to any number we want. We start with and where : these are just our base case values 0 and 1. Then, we compute all three of using just two squares. We can either take the first two of these, in which case our new index is , or the last two, in which case our new index is . Either way, for our new index , we have and , so we can apply these formulas again.
For example, to compute :
- Start with and our two values .
- Compute : our new is .
- Compute : our new is .
- Compute : our new is .1
- Done!
How did I know whether to go from to or to ?
- For the last step, you can save a multiplication because there are direct formulas for and that only require one, and because we aren't going any further we don't need the previous Fibonacci number.↩
The State of the Art
The current best algorithm for computing can be summarized succinctly using the following three equations:
We can use these three equations to chain our way to any number we want. We start with and where : these are just our base case values 0 and 1. Then, we compute all three of using just two squares. We can either take the first two of these, in which case our new index is , or the last two, in which case our new index is . Either way, for our new index , we have and , so we can apply these formulas again.
For example, to compute :
- Start with and our two values .
- Compute : our new is .
- Compute : our new is .
- Compute : our new is .1
- Done!
How did I know whether to go from to or to ?
- For the last step, you can save a multiplication because there are direct formulas for and that only require one, and because we aren't going any further we don't need the previous Fibonacci number.↩