mp_real_partitions_hrr, _mp_real_partitions_hrr
#include <flint/mp_real.h>mp_real_partitions_hrr reads from a table for , uses the pentagonal recurrence while fits a word ( on 64-bit machines), and otherwise the Hardy–Ramanujan–Rademacher formula [Rademacher1937] [Joh2012]
with from arith_hrr_expsum_factored, and the bound for from partitions_rademacher_bound, and each term at the precision it contributes at. Terms of at most about 200 bits are evaluated in batches of dfloat balls, the others in mp_real balls, with obtained as the -th root of (computed by mp_real_exp_notab_squaring or, at huge precision, mp_real_exp_agm). The resulting ball is resolved by mp_real_unique_integer (Integers from balls).
With several threads (flint_set_num_threads, from ) the constants are computed once with the whole thread budget, and the terms are summed in ranges of of about equal cost, each into its own accumulator. The peak memory is about that of computing to the same precision.
_mp_real_partitions_hrr uses the formula for every ; flags is a combination of MP_REAL_PARTITIONS_NO_DFLOAT (all terms in mp_real) and MP_REAL_PARTITIONS_TEST (the rarely taken paths at any ), for testing. partitions_fmpz_fmpz in partitions.h calls these functions. The method is described in Computing the partition function.
References#
- [Rademacher1937] Rademacher, Hans : On the partition function Proc. London Math. Soc vol. 43 (1937) 241–254
- [Joh2012] F. Johansson, "Efficient implementation of the Hardy-Ramanujan-Rademacher formula", LMS Journal of Computation and Mathematics, Volume 15 (2012), 341-359, http://journals.cambridge.org/action/displayAbstract?fromPage=online&aid=8710297
The FLINT team, “mp_real_partitions_hrr, _mp_real_partitions_hrr (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_partitions_hrr.html (generated 2026-11-02).
@misc{flint-doc-mp-real-mp-real-partitions-hrr,
author = {{The FLINT team}},
title = {{mp\_real\_partitions\_hrr, \_mp\_real\_partitions\_hrr (mp\_real.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mp_real/mp_real_partitions_hrr.html},
note = {Generated 2026-11-02}
}