:: Int -> Float package:arithmoi

fibonacci k calculates the k-th Fibonacci number in O(log (abs k)) steps. The index may be negative. This is efficient for calculating single Fibonacci numbers (with large index), but for computing many Fibonacci numbers in close proximity, it is better to use the simple addition formula starting from an appropriate pair of successive Fibonacci numbers.
lucas k computes the k-th Lucas number. Very similar to fibonacci.