SkillAgentSearch skills...

Fibint

Compute Fibonacci numbers efficiently using finite fields

Install / Use

/learn @ruuda/Fibint
About this skill

Quality Score

0/100

Supported Platforms

Universal

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 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.

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated1y ago
Forks1

Languages

C++

Security Score

70/100

Audited on Feb 9, 2025

No findings