ecpp_cornacchia
Synopsis
#include <flint/ecpp.h>Given D < 0, an odd n with \gcd(n, D) = 1 and a square root of D modulo n, finds t, v \ge 0 with t^2 + |D| v^2 = 4n and returns 1, or returns 0 if there is no solution (Cornacchia's algorithm in the form of Cohen [Coh1996, Algorithm 1.5.3]).
References#
- [Coh1996] Cohen, Henri : A course in computational algebraic number theory, Springer, 1996
Cite this page
The FLINT team, “ecpp_cornacchia (ecpp.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ecpp/ecpp_cornacchia.html (generated 2026-10-20).
@misc{flint-doc-ecpp-ecpp-cornacchia,
author = {{The FLINT team}},
title = {{ecpp\_cornacchia (ecpp.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ecpp/ecpp_cornacchia.html},
note = {Generated 2026-10-20}
}