>>13905033Yes. I think this is the best still. I looked at a rough estimate of the number of arithmetic operations and the closed form actually seems to yield more operations. You only have one multiplication and an addition, times 11. The closed form seems to be slower.
I did some basic performance comparison. Results:
0.852018644
7.3665465139999995
5.128104841000001
The first, plain version, is by far the fastest. That makes sense. Even though it's a simple loop, there are few redundant, expensive operations. Performance wise, the closed form fails. I would use the closed form if I want few Fibonacci numbers without any apparent connection. If the Fibonacci numbers needed follow a pattern like in this solution, it's far better to use the iterative approach.
Trying to be too smart is often a mistake that novices make. It's like those first year CS students who learned somewhere that you can do multiplications by two with bit shifts, so they start using it instead of plain multiplication. Trying to be too smart is the Dunning Kruger effect of programming.