FLINT3.7.0-dev

n_ll_factor_rho

Synopsis#include <flint/ulong_extras.h>
int n_ll_factor_rho(nn_ptr factor, ulong nhi, ulong nlo, ulong max_tries, ulong max_iters)source

Pollard–Brent rho for an odd two-limb n with n_{hi} \ne 0. Returns 1 and writes a nontrivial two-limb factor on success, otherwise 0.

max_iters bounds Brent's outer doubling parameter, so each attempt performs about 2\,\mathit{max\_iters} iterations and reaches factors up to roughly (2\,\mathit{max\_iters})^2. The inner loop uses two-limb Montgomery arithmetic and is several times faster than fmpz_factor_pollard_brent at this size.

Cite this page

The FLINT team, “n_ll_factor_rho (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_ll_factor_rho.html (generated 2026-10-20).