gr_generic_fib2_fmpz, gr_generic_fib_fmpz, gr_generic_fib_ui, gr_generic_fib_vec
Synopsis
#include <flint/gr_special.h>Fibonacci numbers by a table for small n and otherwise the doubling formulas F_{2k-1} = F_k^2 + F_{k-1}^2, F_{2k+1} = 4F_k^2 - F_{k-1}^2 + 2(-1)^k along the binary expansion of n. gr_generic_fib2_fmpz sets v to F_n and u to F_{n-1}. The vec version uses the recurrence.
Cite this page
The FLINT team, “gr_generic_fib2_fmpz, gr_generic_fib_fmpz, gr_generic_fib_ui, gr_generic_fib_vec (gr_special.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_special/gr_generic_fib2_fmpz.html (generated 2026-10-20).
@misc{flint-doc-gr-special-gr-generic-fib2-fmpz,
author = {{The FLINT team}},
title = {{gr\_generic\_fib2\_fmpz, gr\_generic\_fib\_fmpz, gr\_generic\_fib\_ui, gr\_generic\_fib\_vec (gr\_special.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_special/gr_generic_fib2_fmpz.html},
note = {Generated 2026-10-20}
}