https://github.com/ruuda/fibint
Compute Fibonacci numbers efficiently using finite fields
https://github.com/ruuda/fibint
Last synced: about 1 year ago
JSON representation
Compute Fibonacci numbers efficiently using finite fields
- Host: GitHub
- URL: https://github.com/ruuda/fibint
- Owner: ruuda
- License: mit
- Created: 2014-06-07T18:51:21.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T19:09:00.000Z (about 6 years ago)
- Last Synced: 2025-04-14T23:43:58.453Z (about 1 year ago)
- Language: C++
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: copying
Awesome Lists containing this project
README
fibint
======
Compute Fibonacci numbers efficiently using finite fields. This allows for
Fibonacci numbers to be computed from a closed-form expression, by using only
integer arithmetic. For any integer width, this makes it possible to compute
all Fibonacci numbers representable by that integer, without resorting to
floating-point numbers or wider integers.
How it works
------------
Instead of using the closed-form expression for computing the n-th Fibonacci
number in the field of real numbers, it uses an analogous closed-form
expression in a finite field that is big enough to contain the largest
representable Fibonacci number.
See my [blog post](https://ruudvanasseldonk.com/2014/07/01/fibonacci-numbers-in-finite-fields)
for a more thorough explanation.
Licence
-------
This project is an implementation of a mathematical concept. The
implementation is licensed under the MIT license. See the file `copying`.