I asked the AI to extract TODOs from comments in the source. We should decide whether we want to make this a new TODO.md, convert to issues, leave somewhere else in one place (e.g. this issue), or ignore.
AI output below:
TODO
Tasks extracted from TODO/FIXME/XXX comments in the FLINT source tree
(main branch, commit 58030f4). Each entry is a rewritten, self-contained
description of the task. Files are named without line numbers, which go stale
quickly; grep the named file for the marker to find the original comment.
Excluded from this list: vendored upstream files (config/config.guess,
config/configfsf.*, COPYING, and the GMP-derived FIXMEs in
acinclude.m4) and changelog prose in doc/source/history.rst.
acb
dot.c — The cutoff for switching to the Gauss complex multiplication
trick in the dot product could be lowered, but it currently competes with
mulhigh in the Karatsuba range; retune once that interaction is understood.
acb_calc
integrate_taylor.c — In acb_calc_integrate_taylor, consider making
the interval midpoint exact and folding the resulting displacement into the
error term for x.
integrate_taylor.c — Use arf arithmetic rather than machine
arithmetic when computing the step size, to avoid overflow.
integrate_taylor.c — Judge convergence by relative rather than absolute
accuracy, e.g. by inspecting the magnitude of f(m).
acb_dirichlet
arb_quadratic_powers.c — Baby-step giant-step could reduce the cost of
computing the vector of quadratic powers to nv multiplications.
gauss_sum.c — acb_dirichlet_gauss_sum factors the conductor even
though the subsequent factor call repeats the work; drop the redundant
factorization.
isolate_hardy_z_zero.c — extend_to_prev_good_gram_node guards against
arb_get_lbound_arf returning a negative bound for a nonnegative input.
Determine whether that can ever happen; if not, delete the function.
jacobi_sum_factor.c — Use an efficient subgroup enumeration instead of
the current approach when factoring Jacobi sums.
jacobi_sum_factor.c — Work out the Gauss sum relations for prime powers
p^e with e > 1 so that this case can be handled too.
l_fmpq_afe.c — Implement decomposition into primitive characters so
that acb_dirichlet_l_fmpq_afe supports imprimitive characters.
qseries_arb.c, qseries_arb_powers.c — The q-series summation runs at
full precision throughout; reduce the working precision as the terms decay
(per step in the _powers variant).
secondary_zeta.c — Decide whether the thread-local cache of Hardy Z
zeros should be exposed as public API for other callers.
secondary_zeta.c — Track a separate precision per cached zero instead
of one precision for the whole cache.
secondary_zeta.c — Implement refinement of already-cached zeros; this
is much cheaper than re-isolating each zero from scratch.
theta_arb.c — Tune the character-order cutoff (currently 30) that
selects between the small-order and naive theta series algorithms.
vec_mellin_arb.c — Truncate the working length in
acb_dirichlet_vec_mellin_arb as terms become negligible.
acb_elliptic
pi.c — Exact argument reduction in acb_elliptic_pi_inc can land
exactly on a branch cut when re(phi) = k/2, giving wrong results; handle
this case.
acb_hypgeom
2f1.c — Inspect the flags for integer c-a and c-b even when c is
inexact, so those cases can use the specialized code paths.
airy_bound.c — Extend acb_hypgeom_airy_bound to also provide bounds
for real z >= 0.
bessel_j.c — Generalize the derivative bound for J_nu(z) beyond the
currently supported low orders.
bessel_j.c — Extend the hardcoded table used for the commonly needed
derivative bounds.
bessel_j.c — The cancellation estimate for the transition region is
crude; estimate it more accurately for large nu.
bessel_j.c — Find a cleaner way to fall back on direct magnitude bounds
for wide inputs, ideally by detecting wide intervals up front rather than
after the enclosure comes out useless.
gamma.c — Improve the bound computation used in acb_hypgeom_rgamma.
m.c — In acb_hypgeom_m_choose, estimate the extra working precision
needed for large m instead of using a fixed guess.
pfq_series_sum.c — Tune the rectangular-splitting versus basecase
choice for larger series lengths.
pfq_series_sum.c — Consider using binary splitting when n is large
enough, for better numerical stability.
pfq_series_sum_bs.c — When a pole falls near the end of the summation
range, use the fast algorithm for the start or middle segment and the
basecase algorithm only for the tail.
test/t-2f1.c — Add test coverage for the a-c and b-c integer cases
once they are implemented.
acb_mat
approx_eig_qr.c — Two items inherited from the mpmath original this was
ported from: implement balancing, and implement aggressive early deflation.
eig_enclosure_rump.c — The nonnegative eigenvalue bound uses a Perron
root bound; add a direct formula for the k = 2 case.
eig_enclosure_rump.c — Consider lowering the working precision of the
eigenvalue bound when the requested precision is very high.
eig_enclosure_rump.c — Determine and document a reasonable iteration
count for the Rump enclosure loop instead of the current ad hoc value.
eig_enclosure_rump.c — Likewise, determine a principled size for the
inflation epsilon.
eig_enclosure_rump.c — Consider inflating the candidate matrix Y
elementwise rather than uniformly.
acb_poly
acb_poly.h — Document _acb_poly_binomial_pow_acb_series,
_acb_poly_acb_pow_cpx and _acb_poly_acb_invpow_cpx.
div_root.c — Avoid the extra assignments in _acb_poly_div_root while
still supporting aliasing of input and output.
divrem.c — Tighten the acb_poly division-with-remainder code
(allocation and precision handling).
gamma_series.c — Precompute z^2 in the binary splitting recursion
instead of recomputing it at every node.
gamma_series.c — Use div_series instead of the current approach when
the rising factorial is short, once div_series has a good basecase.
polylog_series.c — Handle the cases where |Li_s(z)| is very small or
very large specially when choosing the number of terms.
polylog_series.c — Add a cosecant function so this code does not have
to build it from sine and division.
polylog_series.c — Allow threading in _acb_poly_polylog_cpx_small.
rgamma_series.c — Consider using div_series here once it has a good
basecase.
test/t-atan_series.c — The test does not check the first coefficient of
the result; extend it to do so.
test/t-find_roots_cd_poly.c — Make the tested function return/add a
radius so the enclosure can be checked.
zeta_em_bound.c — The bound uses atan where a simple bound by pi/2
would also apply and be cheaper; combine the two.
zeta_em_bound.c — Only an upper bound on the product is needed; write a
dedicated function instead of computing the full product.
zeta_em_sum.c — The deflated Euler–Maclaurin sum is numerically
unstable for high derivatives and divides by zero when s contains 1. Find a
stable way to evaluate ((N+a)^y - 1)/y for y with nonzero constant term
without dividing.
zeta_em_tail_naive.c — Combine this multiplication with the preceding
one to save work.
acb_theta
ql_jet_fd.c — Adjust the working precision so that 2^(-prec) roughly
matches the computed error bound, rather than keeping the input precision.
siegel_reduce.c — Choose the precision used for the infinity-norm bound
of the reduction matrix more carefully.
arb
exp_taylor_rs.c — Consider dropping the evenness assumption in the
rectangular splitting scheme, since sign issues do not arise here.
exp_taylor_rs.c — Doing so requires fixing the construction of the
powers below that point.
gamma.c — Verify (or assert) the assumption n >= 1 in
acb_gamma_bound_phase.
hypot.c — Use arb_fmma for the fused multiply-add in arb_hypot.
sin_cos_wide.c — The double-precision sin_cos helper is the
bottleneck of wide-interval trigonometry; write an mpn version.
arb_calc
refine_root_bisect.c — Refactor and share code between
refine_root_bisect.c and isolate_roots.c.
refine_root_bisect.c — arb_calc_partition always splits at the
midpoint; experiment with other split points.
arb_fmpz_poly
real_roots.c — fmpz_poly_isolate_real_roots usually detects exact
roots landing on bisection points, but its contract does not guarantee it.
Add explicit checks here to prevent potential hangs.
arb_hypgeom
erf.c — Allow a precomputed Gamma(a) to be passed into the bit-burst
computation of the incomplete gamma function.
erfinv.c — Use a good direct approximation for erfcinv instead of the
current fallback in arb_erfinv_approx_huge.
gamma_upper_fmpq_step_bsplit.c — Find a clean way to emit this
diagnostic message through flint_throw.
arb_poly
div_root.c — Avoid the extra assignments in _arb_poly_div_root while
still supporting aliasing.
divrem.c — Tighten the arb_poly division-with-remainder code.
gamma_series.c — Precompute z^2 in the binary splitting recursion.
gamma_series.c — Prefer div_series when the rising factorial is
short, once div_series has a good basecase.
mullow_block.c — Only write and use the double approximations when the
block is short enough for them to pay off.
mullow_block.c — Fuse this two-step conversion into a single operation.
rgamma_series.c — Evaluate whether div_series is preferable here,
once it has a good basecase.
test/t-atan_series.c — The test skips the first coefficient of the
result; extend it to check that too.
arf
add.c — Decide whether top-aligning the slong operand in arf_add_si
is worth the extra work.
add_mpn.c — Add a fast path for shift == 0 in _arf_add_mpn; this is
the common case.
mul_rnd_down.c — The limb-count cutoff for delegating to MPFR is a
placeholder; determine proper cutoffs.
submul.c — Make arf_submul_mpz more efficient than the current
convert-then-submul approach.
arith
dedekind_cosine_sum_factored.c — The factored Dedekind cosine sum has
not been tested on 32-bit platforms; do so.
divisors.c — arith_divisors does not check for overflow of the
divisor count for huge n; add the check.
ramanujan_tau.c — Handle overflow properly in the multiplicative
reconstruction of tau(n) from its factorization.
bernoulli
fmpq_ui_multi_mod.c — Optimize the CRT basecase used when combining
Bernoulli number residues.
ca
ca_types.h — ca_types.h includes all of fmpz_mpoly.h only for
fmpz_mpoly_vec_struct; move that struct to fmpz_types.h instead.
ca_types.h — Remove the qqbar.h and nf_elem.h includes from
ca_types.h.
check_ge.c — For comparisons that cannot be decided directly, consider
subtracting and computing the sign; symbolic cancellation may resolve more
cases.
check_is_zero.c — Factor out monomials before testing for zero.
check_is_zero.c — Also remove the content of the expression before
testing.
conj.c — Add dedicated handling for conjugation of CA_Conjugate,
CA_Sign and similar extension functions.
conj.c — Conjugate purely imaginary quantities by negating them instead
of building a new expression.
conj.c — Consider re-evaluating functions under conjugation, allowing
new objects to be inserted into the field.
conj.c — Decide when ca_conj_deep should conjugate an extension
number directly rather than going through ca_set_qqbar for its rewriting.
get_fexpr.c — Replace the chain of comparisons for named constants with
a lookup table.
log.c — Extend fast detection of roots of unity in ca_log to elements
of number fields and other representations.
pow.c — Special-case all roots of unity in ca_pow_fmpz, not just the
currently handled ones.
set_qqbar.c — Use a fast search table when looking up an existing
qqbar field in the context.
ca_field
build_ideal.c — Separate positive and negative exponents when proving
logarithmic relations, avoiding the inverses.
build_ideal.c — Avoid duplicating these computations when proving
multiplicative relations.
build_ideal.c — Handle more special cases (including roots of unity)
when inserting multiplicative relations.
ca_mat
find_pivot.c — Support in-place simplification of entries during the
expensive second pivot search pass, so the work is not thrown away.
mul.c — Tune the algorithm selection in ca_mat_mul for entry degree
and bit size.
right_kernel.c, rref_fflu.c, rref_lu.c — These loops handle a
T_UNKNOWN result that should not arise; save the pivot data from the LU
step so the outcome is known.
rref_lu.c — Add a fast path for single-row matrices.
ca_poly
div_series.c — Also take the inversion-based branch when inversion
alone is fast and the numerator length is small.
mullow.c — Handle mixed cases (operands in different representations)
in _ca_poly_mullow_fmpqs.
mullow_same_nf.c — Inspect the actual elements to derive degree bounds
rather than using worst-case bounds.
calcium
calcium.h — calcium_write_free duplicates functionality; remove
either it or truth_println in gr.h.
dirichlet
chi_vec_primeloop.c — Reuse the precomputed discrete logarithm data
already present in the prime structure, if available.
dlog
rho.c — The general Pollard rho discrete log algorithm hangs; fix it.
vec_eratos_add.c — Sieving by m*p^e could be faster, but the relation
v[p*m] = v[p]*v[m] does not apply; find a workable formulation.
vec_sieve.c, vec_sieve_precomp.c — Tune the crossover between
discrete logarithm and index calculus methods.
vec_sieve.c — The sieve limit is hardcoded to 50; tune it.
fexpr
fexpr.h — Work around the circular include: ca_types.h needs
calcium_stream, but qqbar.h defines fexpr_t-based functions only when
FEXPR_H is defined, which is true before fexpr_t itself exists.
set_fmpz_mpoly.c — Unexplained FIXME in fexpr_set_fmpz_mpoly;
determine what is wrong with the term-construction branch and fix it.
write_latex.c — fexpr_write_latex_matrix handles row grouping but not
columns; add column handling.
fft_small
mulmod_satisfies_bounds.c — Complete the analysis of truncated reverse
butterflies for 50-bit primes, proving the output stays in (-2n, 2n)
whenever the input does.
nmod_poly_mul.c — Consider storing bn and the minimum of an, bn in
the precomputed structure, in case they are much smaller than an.
fixed
exp_bitwise_rs.c — The last arb dependency in this tier is the
seven-logarithm prime-vector combination used for i <= 6; replace it with
native fixed-point code.
sin_cos_bitwise_rs.c — Likewise, the remaining arb dependency here is
the Gaussian-prime vector combination for i <= 3.
fmpq_mat
get_fmpz_mat_mod_fmpz.c — Clear denominators up front to avoid repeated
expensive modular inversions.
set_fmpz_mat_mod_fmpz.c — Handle special cases (zeros, small integers)
efficiently during rational reconstruction.
solve_dixon.c, solve_multi_mod.c — The modulus bound assumes
numerator and denominator bounds are comparable; when one is much smaller, a
tighter bound (2ND) can be used.
test/t-inv.c, test/t-solve.c, test/t-solve_dixon.c,
test/t-solve_fmpz_mat.c, test/t-solve_fmpz_mat_dixon.c,
test/t-solve_fmpz_mat_fraction_free.c, test/t-solve_fmpz_mat_multi_mod.c,
test/t-solve_fraction_free.c, test/t-solve_multi_mod.c — These tests
build nonsingular random matrices inline; replace the ad hoc loop with a
proper randtest function.
fmpq_poly
div.c, divrem.c, rem.c — These routines compute a full
quotient/remainder where only part is needed; avoid the unnecessary work.
divrem.c, rem.c — Confirm that allocating lenA coefficients for the
remainder is really required, and tighten if not.
interpolate_multi_mod.c — Once a good coefficient bound is available,
stop overshooting the number of CRT primes.
invsqrt_series.c — Determine whether the final fmpq_poly_canonicalise
call is necessary.
io.c, set_str.c — Remove these deprecated mpq_t-array helpers and
the legacy string parsing entry point.
mul.c — When the content gcd1/gcd2 is large relative to the
polynomial degrees, divide out common factors before multiplying rather than
after.
rem_powers_precomp.c — The m >= 2*n branch does not use the
precomputed powers; make it do so.
fmpz
bin_uiui.c — Add a fast path for small n, k in the binomial
coefficient.
CRT.c — _fmpz_CRT assumes r1 has been reduced into [0, m1);
document and add tests covering this precondition.
fdiv.c — Speed up flint_mpn_divrem_preinvn enough that the
special-cased small-remainder branch can be dropped.
gcd.c — Call mpn_gcd directly to avoid redoing normalization work
already performed by fmpz_gcd.
link/fmpz_gc.c — _fmpz_cleanup_mpz_content leaves stale entries in
mpz_arr; remove the freed entries and compact the array.
fmpz_factor
ecm.c — Consider delaying promotion of the found factor f until after
the stage 2 precomputations are complete.
factor.c, factor_trial.c, factor_trial_range.c — When the caller
only needs squarefree-ness (Möbius function and similar), abort as soon as a
repeated factor is found instead of completing the factorization.
fmpz_lll
check_babai_heuristic.c — The norm helper uses DBL_MIN as a threshold
in a questionable way; establish a correct bound.
check_babai_heuristic.c — Consider converting the multiplier to an
exact integer when working at high precision.
check_babai_heuristic.c — Alternatively, make nfloat detect small
multipliers and take a fast path.
is_reduced_mpfr.c, is_reduced_mpfr_with_removal.c — The MPFR code
stores Q transposed so vector operations apply; apply the same optimization
to the double-precision code.
is_reduced_mpfr.c, is_reduced_mpfr_with_removal.c — Replace the
scalar loops in these checks with dot products.
is_reduced_mpfr_with_removal.c — The original MPFR code did not specify
a rounding mode here; confirm that the chosen mode is correct.
test/t-lll.c — Under the current definition of fmpz_mat_is_reduced,
this input counts as unreduced; decide whether the definition or the test is
wrong.
fmpz_mat
fmpz_mat.h — fmpz_mat_CRT_ui avoids fmpz_comb for small inputs
because its basecase is poor; improve fmpz_comb so the workaround can go.
hnf.c — Dispatch to the Micciancio–Warinschi or Pauderis–Storjohann
Hermite normal form algorithms once they are implemented.
is_reduced.c, is_reduced_with_removal.c — For very small matrices,
use a division-free algorithm over Z instead of working over Q.
is_reduced.c, is_reduced_with_removal.c — Neither reducedness check
is tuned at all; establish sensible cutoffs.
mul.c — For very large dimensions (over ~10000), consider calling
Strassen directly to reduce memory use.
mul.c — Retune the FFT-based multiplication cutoff for squaring, and
possibly for BLAS-backed builds.
permanent.c — For non-uniform matrices, use rowwise or columnwise entry
bounds, which can be tighter than a single matrix-wide bound.
permanent.c — Make the algorithm cutoff depend on the entry bit size
Abits.
solve_dixon.c — When the numerator and denominator bounds differ
greatly, a tighter modulus bound (2ND) can be used.
test/t-rref_mul.c — Determine whether the returned denominator den2
is ever legitimately zero, and tighten or remove the guard accordingly.
fmpz_mod_mpoly
buchberger_naive.c — Exponent vectors are packed one per word; use
tighter packing for small exponents, given a guarantee on the exponent range.
fmpz_mod_mpoly_factor
bpoly_factor_smprime.c — Port this bivariate lifting precision strategy
to the other bivariate polynomial factorers.
factor.c — Use Kaltofen's leading coefficient reconstruction
(lcc_kaltofen) in the irreducible-factor path.
fmpz_mod_bpoly.c — Speed up fmpz_mod_bpoly_mul_series.
fmpz_mod_poly
berlekamp_massey.c — Both reduction branches are always valid; find the
right cutoff between them.
berlekamp_massey.c — Get the half-GCD algorithm working in this branch.
inlines.c — Move these inline function definitions out into their own
files.
inv_series_newton_f.c, radix.c — _fmpz_mod_poly_inv_series no
longer accepts a precomputed inverse leading coefficient; add back a variant
that does, so these callers stop recomputing it.
fmpz_mod_poly_factor
factor_kaltofen_shoup.c — The threaded and non-threaded distinct-degree
factorization paths duplicate a lot of code; merge them.
factor_squarefree.c — Unexplained conversion of the modulus to a single
word; determine whether this is correct for large moduli.
fmpz_mpoly
buchberger_naive.c — Use tighter exponent packing for small exponents
instead of one word per exponent.
div.c, divrem.c, divrem_ideal.c, quasidiv.c, quasidivrem.c,
quasidivrem_ideal.c — These entry points fall back on a generic path
flagged as unfinished; implement proper dedicated algorithms.
divides_heap_threaded.c — fmpz_mpoly_ts_append relies on x86 store
ordering; add explicit memory barriers so threaded division is correct on
weakly ordered architectures (see the fix already applied in gr_mpoly).
fit_length_reset_bits.c — Decouple the coefficient and exponent
allocations, as already done in nmod_mpoly and fq_nmod_mpoly.
mul_monomial.c — Once the exponent/coefficient allocations are
decoupled, move this routine into the generic mpoly module.
sort_terms.c — The radix sort recursion depth is proportional to
N*FLINT_BITS; consider an iterative version (low priority).
sqrt_heap.c — Port the small-coefficient (no fmpz arithmetic)
strategy used here to the other fmpz_mpoly multiplication and division
routines.
symmetric.c — Generating combinations uses Knuth's algorithm L;
algorithm T is faster.
to_from_fmpz_poly.c — Handle multiprecision exponents in the conversion
between fmpz_mpoly and univariate fmpz_poly.
fmpz_mpoly_factor
gcd_algo.c — When picking the main variable, take the expected degree
of the GCD into account, and add a size limit to univar_pseudo_gcd so
runaway coefficient growth aborts the attempt.
gcd_algo.c — Algorithm selection is incomplete: a single-bit
MPOLY_GCD_USE_* value should force exactly that algorithm, and a multi-bit
value should choose among the set bits.
gcd_algo.c — Add a bivariate heuristic to the small-input GCD path.
gcd_zippel.c — Add a divisibility test here when the coefficients are
small enough for it to be cheap.
irred_zippel.c — The divisibility precondition in
_fmpz_mpoly_modpk_taylor_coeff is only asserted, not handled; make the code
robust.
lcc_kaltofen.c — The lifting code works for mvars = 1 but goes
through the general path; consider a dedicated special case.
fmpz_poly
bit_unpack.c — fmpz_poly_bit_unpack allocates and copies far more
than necessary; rewrite it to avoid the waste.
interpolate_multi_mod.c — With a good coefficient bound available, stop
overshooting the number of CRT primes.
pseudo_divrem_divconquer.c — This branch silently assumes the input A
may be modified in place; document or enforce that contract.
sqrt_divconquer.c, sqrtrem_divconquer.c — Implement the middle
product so the Hanrot–Quercia–Zimmermann Sqrt function (which needs it) can
be used.
fmpz_poly_factor
inflation_is_irreducible_capelli.c — Make the p = 2 Capelli
certificate two-sided for deg T >= 3 by explicitly reconstructing gamma
with gamma^2 = theta in K = Q[y]/(T): take componentwise square roots at
a prime minimizing the local factor count, Hensel-lift, and resolve the sign
ambiguity.
fmpz_poly_mat
test/t-sqr_KS.c — Add separate tests for the unsigned Kronecker
substitution variant.
fmpz_poly_q
div.c, sub.c — These functions duplicate logic that already exists in
the multiplication and addition code; share it instead of maintaining two
copies.
div.c — Verify that the numerator carries the correct sign after
canonicalisation.
fmpz_vec
multi_CRT_ui.c — Port the optimizations already used in the fmpz_mat
multi-modular CRT code to the vector version.
fq
ctx_init.c — Add coverage for very large primes in the context
initialization tests.
inlines.c — Remove this compatibility shim.
norm.c — The non-Conway branch of _fq_norm is untested because the
standard contexts always use Conway polynomials; add a test with a custom
modulus.
norm.c — Make the modulus polynomial monic before computing the
resultant-based norm.
pow_ui.c — Optimize fq_pow_ui; it currently uses a naive
square-and-multiply.
fq_default_mat
fq_default_mat.h — Add matrix reading (input) functions to match the
existing print functions.
fq_mat_templates
fq_mat_templates.h — Add matrix reading (input) functions to the
templated finite field matrix interface.
mul_KS.c — Make Kronecker substitution multiplication generic by
introducing templated bits_needed and bit_pack operations.
fq_nmod
io.c — fq_nmod_ctx_fprint needs work (formatting and error handling);
the comment is unexplained.
norm.c — The non-Conway branch of _fq_nmod_norm is untested; add
coverage with a custom modulus.
norm.c — Make the modulus polynomial monic before the resultant
computation.
pow.c — Move the windowed exponentiation helper into its own function
and optimize it.
pth_root.c — Use modular composition to compute the p-th root instead
of the current approach.
reduce.c — Merge this reduction code with
_nmod_poly_divrem_try_sparse.
fq_nmod_mpoly
fq_nmod_embed.c — bad_n_fq_embed_sm_to_lg allocates a local
n_poly_stack_t; pass the caller's stack in instead.
gcd_zippel2.c — Promote this helper to a real
fq_nmod_mpolyn_interp_mcrt_lg_mpoly implementation.
sort_terms.c — Radix sort recursion depth is proportional to
N*FLINT_BITS; consider an iterative version.
sqrt_heap.c — Use _n_fq_dot_lazy_size to choose the lazy reduction
size instead of the current fixed choice.
fq_nmod_mpoly_factor
factor.c — Use Kaltofen's leading coefficient reconstruction
(lcc_kaltofen).
n_bpoly_fq_factor_lgprime.c — Remove the mpoly_ctx_t parameter from
the bad_fq_nmod_mpoly_embed_chooser interface; it is not needed.
n_bpoly_fq_factor_smprime.c — Implement CLD (coefficients of the
logarithmic derivative) bounds to prune the recombination search.
fq_poly_factor_templates
factor_equal_deg_prob.c — The exponent d * ctx_degree can overflow;
detect and handle it.
fq_poly_templates
io.c — When a coefficient has only one nonzero term, omit the
surrounding parentheses when pretty-printing.
fq_zech
pow.c — Move the exponentiation loop into a separate function and
optimize it.
set_fmpz.c — Clean up the conversion from fmpz to fq_zech.
fq_zech_mpoly
get_set_nmod_mpoly.c — Move this conversion helper to a more
appropriate module and make it faster.
fq_zech_mpoly_factor
bpoly_factor_smprime.c — Implement CLD bounds for the bivariate factor
recombination.
factor.c — fq_zech_mpoly_factor_algo currently delegates everything
to fq_nmod; give it a native implementation.
generic_files
io_vprintf_impl.h — Add options for compact versus spacious printing of
polynomials.
io_vprintf_impl.h — Move these type-specific print helpers into their
respective modules.
io_vprintf_impl.h — Let callers pass a precision to the arb-family
printing functions.
io_vprintf_impl.h — Add an option to print numbers in a base other than
10.
io_vprintf_impl.h — Add non-compact printing, with options for variable
indentation and aligned columns.
io_vprintf_impl.h — Square brackets delimit both vectors/matrices here
and arb_get_str output; decide whether to change one of them.
io_vprintf_impl.h — Allow the generator symbol used when printing
polynomials to be specified.
io_vprintf_impl.h — If terminal width and height can be detected, elide
the middle of long vectors, matrices and polynomials by default (as Julia
does).
gr
gr_types.h — Replace this local attribute macro with
FLINT_WARN_UNUSED.
fmpq.c — Use the return value of fmpz_root in _gr_fmpq_pow_fmpz,
and do the same in the qqbar nth root code.
fmpq.c — Handle mixed-representation cases in _gr_fmpq_poly_mulmid.
fraction.c — Recognize other types with internal fractions (nf,
fmpq_poly, fmpq_mpoly, Frac(R)[x], …) directly rather than going
through a generic conversion.
fraction.c — This fast branch in _gr_fraction_is_one is not
necessarily faster than the general path; benchmark it.
fraction.c — Determine whether the special case in the early-reduction
addition is worth keeping.
polynomial.c — Account for sparsity when choosing a factoring strategy
for generic polynomials.
qqbar.c — Compute the squarefree factorization in the original ring
before converting to qqbar; this should generally be faster.
test_ring.c — Work out how to test the _other operation variants in
cases where set_other itself fails.
gr_generic
set_str_expr.c — Exponent parsing only accepts integer literals;
support full expressions and rational exponents.
gr_mat
fflu.c — When the pivot element is known to be invertible, exploit that
instead of taking the general division path.
func_jordan.c — Apply the same inexact-ring fallback (diagonalization
with distinct eigenvalues) in gr_mat_jordan_form.
func_jordan.c — Find a better approach than falling back on
diagonalization for inexact rings.
gr_poly_solve_lode_newton.c — Introduce a Newton iteration context
struct to carry Z and A_denominator_inv between steps.
gr_poly_solve_lode_newton.c — Three full multiplications in
_gr_mat_gr_poly_solve_lode_newton_step should be truncated multiplications
(mullow).
gr_poly_solve_lode_newton.c — One product in
_gr_mat_gr_poly_solve_lode_newton_step should be a middle product
(mulmid).
gr_poly_solve_lode_newton.c — Compute only the high part of the
derivative rather than the whole thing.
gr_poly_solve_lode_newton.c — Avoid the explicit shifts by computing
only the high part of the integral.
gr_poly_solve_lode_newton.c — Avoid copying the matrix at each Newton
step.
gr_poly_solve_lode_newton.c — Add a basecase for short lengths instead
of recursing all the way down.
gr_poly_solve_lode_newton.c — Find a way to cache A_denominator_inv
across calls.
is_orthogonal.c — Over rings with coefficient explosion, compare two
half-length products for negated equality instead of testing a full product
against zero.
jordan_transformation.c — Special-case eigenvalues of multiplicity 1 in
the block construction below, as is already done above.
jordan_transformation.c — Determine whether the eigenvector list built
in gr_mat_jordan_transformation needs to be sorted.
mul_classical.c — Consider applying the same inlining strategy in
nonsingular_solve and related routines.
mul_rosowski.c — The implementation uses 1-based indexing to mirror the
source paper; consider rewriting with 0-based indices.
mul_rosowski.c — Temporaries appear to be initialized even when the
inner loops are never entered; avoid the waste.
nullspace.c, rref_fflu.c, rref_lu.c — A T_UNKNOWN result should
not be possible when reading back pivots; save the pivot data from the
LU/FFLU step.
permanent.c — Generalize gr_mat_permanent to rectangular matrices;
add an integer version optimized for small entries; support sign reversals in
the cofactor expansion so gr_mat_det_cofactor can share it; exploit
sparsity; and parallelize the cofactor expansion.
rank.c — The LU versus FFLU choice needs tuning, especially where fast
matrix multiplication is available (ca_mat uses LU for number fields).
rref_lu.c — Add a fast path for single-row matrices.
test/t-gr_poly_solve_lode_newton.c — Use a gr_ore_poly_t for the
temporary polynomial instead of the current workaround.
gr_mpoly
ctx.c — Decide how to find inverses of nonconstant polynomials over
non-integral domains when building the generator list.
divides_heap_threaded.c — Port the release-fence guard added here to
fmpz_mpoly and nmod_mpoly, where threaded division is currently disabled
on ARM.
set_other.c — Replace the quadratic variable-name matching with a
faster algorithm.
gr_poly
compose_mod_brent_kung.c, compose_mod_brent_kung_preinv.c — The code
assumes squaring is cheaper than multiplication, which is ring-dependent;
make the choice explicit.
compose_mod_brent_kung_precomp_preinv.c — Clarify why the row count is
passed separately rather than read from A->r.
compose_mod_brent_kung_precomp_preinv.c — Validate the dimensions of
the precomputed matrix A.
div_series_newton.c — Tighten the allocations once a middle product is
available.
gcd_hgcd.c, hgcd.c, resultant_hgcd.c — These half-GCD routines
happen to support aliasing, but no caller other than the top-level wrapper
should rely on it; either document the guarantee or remove the reliance.
inv.c — gr_poly_inv may wrongly return GR_DOMAIN for nonconstant
polynomials over non-integral domains; compare against AbstractAlgebra's
behaviour.
mul_karatsuba.c — Add a self-recursive Karatsuba variant that reuses
its scratch space.
mul_toom33.c — Add a squaring version of Toom-3.
mul_toom33.c — Skip unnecessary zero-extension of the intermediate
vectors and tighten the allocations.
mullow_bivariate_KS.c — Support base types other than the currently
handled ones in bivariate Kronecker substitution.
mullow_toom_serial.c — The interpolation matrix is built over ctx
itself; in some cases a subring or extension ring would be more appropriate.
mullow_toom_serial.c — Consider reciprocal evaluation points (1/2 etc.)
for the fmpz_mat interpolation variant; this should yield smaller
denominators.
mulmid.c — Write a real generic middle product; the current code just
falls back on mullow.
mulmod_preinv.c — _gr_poly_mulmod_preinv should not require its
inputs to be already reduced.
newton_basis.c — Clarify whether the n parameter means degree or
length, and consider reordering the arguments to put n before the basis.
revert_series.c — Determine when squaring should be preferred for
computing powers here and in compose_series_brent_kung.
tan_series.c — Make the choice between the exponential-quotient and
direct tangent methods precision-dependent, rather than always favouring the
former for large arguments.
gr_series
series.c — Add optimizations for the case of a length-1 denominator.
series.c — Use gr_poly_series_divexact once a non-basecase
implementation exists.
series.c — Add a special case for a length-1 divisor.
series.c — When the polynomials are short compared to the requested
precision, try an exact polynomial division before falling back on power
series division.
gr_special
bessel_j_jet.c — Use gr_is_integer instead of the current ad hoc
integrality test.
bessel_j_jet.c — Handle gr_is_zero(z) == T_UNKNOWN via Fungrim entry
2488BB, which needs gr_poly_binomial_transform (not yet implemented).
fib.c — For huge numerical Fibonacci values, Binet's formula with
exp/log should be faster than iteration.
fib.c — Apply a single iteration directly to the lookup table, as
fmpz_fib_ui does.
fib.c — For exact infinite rings, call mpz_fib_ui for n below
roughly 10000; fmpz already overrides this but QQ and others would
benefit too.
gr_vec
product.c — Implement algorithm selection in the generic vector
product.
sum.c — Implement algorithm selection in the generic vector sum: binary
splitting is needed for optimal complexity over fractions, so the cutoff
should be lower there without adding overhead for rings with cheap addition.
longlong
longlong.h — A workaround is in place for a code generation bug in
Clang 16 and later; revisit once the compiler bug is fixed.
mag
mag.h — Rename these fmpz exponent helpers and move them to
fmpz_extras.
mag.h — Document mag_get_d_log2_approx.
mag.h — Add tests for mag_bin_uiui, mag_bernoulli_div_fac_ui and
the functions declared after mag_set_ui_lower.
add.c — Combine these two rounding steps in mag_add into one.
root.c — mag_root rewrites the argument as exp(log(1+2^(kn)x)/n) 2^-k; this rescaling is probably unnecessary with the current exp/log
implementations.
test/t-d_log_lower_bound.c, test/t-d_log_upper_bound.c,
test/t-set_d.c, test/t-set_d_2exp_fmpz.c — These tests define a local
d_randtest2 because d_randtest does not produce a good enough spread of
doubles; improve d_randtest and drop the duplicated helper.
mpn_extras
mpn_extras.h — Add generic hardcoded mullow implementations for the
non-assembly build path.
mpn_extras.h — The mulhigh/mullow tuning constants are calibrated for
x86_64_adx with fft_small; add tuning for other configurations.
mpn_extras.h — The code assumes the same parameters are optimal for
both mulhigh and mullow; verify or split the tuning.
mpn_extras.h — flint_mpn_mul_or_mullow_n has 2n limbs of scratch
available; exploit this in the Mulders range by calling Mulders directly
instead of allocating.
divrem_preinvn.c, mod_preinvn.c — Add fixed-length code for small
n, use an unbalanced mulhigh in the second loop, and use mullow.
mulmod_preinvn.c — Add fixed-length code for more small n (noting
that 1x1 cannot use nmod_mul, since the inverses are defined
differently), and use mullow.
get_str.c — Improve the radix conversion code so it beats GMP in the
fft_small range too, rather than delegating.
mul_toom22.c — The unconditional call to toom32_mul guards against
growing unbalance; make it conditional on MUL_TOOM33_THRESHOLD / MUL_TOOM22_THRESHOLD and MUL_TOOM22_THRESHOLD.
mul_toom32.c — Consider keeping v1[2*n] and vm1[2*n] in scalar
variables rather than in memory.
mul_toom32.c — Use mpn_add_n_sub_n for the main part of this
interpolation step.
mul_toom32.c — Eliminate the second vm1_neg conditional by swapping
the locations of the +1 and -1 evaluation values.
mul_toom32.c — Determine whether support for s + t == n is actually
needed.
arm64/mul_2.asm — Find a better asymptotic algorithm (currently only
~8% faster than mul_1 + addmul_1 on M1), and avoid pushing r13 to the
stack.
x86_64/broadwell/mul_hard.asm — Replace the hardcoded
flint_mpn_mul_M_N variants with flint_mpn_mul_M_n taking n in a
register (%rcx) to shrink the code; fix latencies; minimize 32-bit register
instructions; and investigate partial stack storage instead of registers.
x86_64/broadwell/mulhigh_hard.asm — Interleave independent work to
avoid latency penalties, and move 32-bit operations to %rax–%rbp
registers to save encoding bytes.
x86_64/broadwell/mulhigh_normalised_hard.asm — Rewrite the n = 6, 7, 8 cases in the style already used for n < 6.
x86_64/broadwell/sqrhigh_normalised_hard.asm — Use the sign flag from
adc instead of an explicit test.
x86_64/x86_64-defs.m4 — The LEA macro should never need a GOT entry,
so the simpler variant could always be used; first work out what happens for
not-yet-hidden symbols.
x86_64/broadwell/flint-mparam.h — Broadwell tuning parameters are
copied from the generic x86-64 file; measure and set real values.
x86_64/icelake/flint-mparam.h, x86_64/meteorlake/flint-mparam.h,
x86_64/raptorlake/flint-mparam.h, x86_64/tigerlake/flint-mparam.h —
These tuning parameters are copied verbatim from Skylake; measure each
microarchitecture.
x86_64/zen4/flint-mparam.h — Zen 4 tuning parameters are copied from
Zen 3; measure them.
profile/p-mulhigh.c, profile/p-sqrhigh.c — Remove the temporary guard
once mulhigh/sqrhigh are fully implemented.
profile/p-mulmod_preinvn.c — The profiling harness uses prof_*
routines that only exist on x86; provide them or guard the profile elsewhere.
tune/tune-mulhigh.c, tune/tune-sqrhigh.c — Remove the preprocessor
conditional wrapping the tuning programs.
mpn_mod
mat_mul_waksman.c — The scratch limb count is sized for any unreduced
value plus a sign bit; tighten this bound.
poly_mullow_fft_small.c — Count actual coefficient bits, so small
inputs get a cheaper transform size.
poly_mullow_karatsuba.c — Consider doing modular additions and
subtractions instead of widening the working limb count.
poly_mullow_karatsuba.c — The middle product accepts general
nlo/nhi ranges but only saves work on reductions; make it actually skip
the unneeded multiplications.
mpoly
is_poly.c — mpoly_is_poly could be made faster.
misc.c — Consider short-circuiting mpoly_monomial_msub_ui_array and
mpoly_monomial_madd_ui_array when the two exponent vectors are identical.
n_poly
n_poly.h — Unexplained FIXME on _n_fq_mul_ui; determine what is
wrong and fix or remove the marker.
n_fq_poly_divrem.c — Clarify why lenA rather than lenB is used here
in the divide-and-conquer division.
nf_elem
equal.c — Only compute the GCD in the equality test when it is expected
to save time.
nfloat
nfloat.h — Decide whether special values are better encoded in the
exponent field or the sign field.
nfloat.h — Decide whether to support signed zero, possibly as an
option.
complex.c — Optimize the rare branch of _nfloat_complex_sqr_standard
as well.
dot.c — Stop relying on ctx->sizeof_elem so real dot products can be
called from complex context objects.
dot.c — The final perturbation is accommodated by bumping the exponent;
instead keep the exponent and check for overflow while performing the
perturbation.
dot.c — The error bound follows Theorem 7 of the reference paper;
improve it for sparse or exact dot products.
dot.c — On 32-bit systems the accumulator can overflow when both
nlimbs and len are large; detect and intercept this.
dot.c — Verify carefully that the rounded partial sums cannot overflow
the guard bits in re_s and im_s.
dot.c — Use the truncating variant also when the term in question is
small.
mat_mul.c — The block-size condition in nfloat_mat_mul_block is
wrong; work out the correct one.
mat_mul.c — Support fast matrix multiplication when inf/nan values or
directed rounding are in play.
nfixed.c — The Strassen error bound always includes the border
correction for odd dimensions; add it conditionally instead.
test/t-nfloat_directed.c — Make the directed rounding tests generic
rather than nfloat-specific.
test/t-nfloat_directed.c — Extend the directed rounding tests to cover
vector operations.
nmod
nmod.h — Document nmod_addmul and the related a*b + c*d helper.
nmod.h — Decide whether the Montgomery context should cache the
constant 1; it would slow down context creation when unused.
gr_redc.c — Precompute redc(R) and invert in Montgomery space, so one
conversion can be skipped.
gr_redc.c — Combine the _nmod_vec_dot and REDC techniques in the
vector product.
nmod_mat
charpoly.c — Make the algorithm cutoff in nmod_mat_charpoly depend on
the modulus.
lu_classical_delayed.c — Re-examine the delayed-reduction method
selection in light of the recent dot product changes.
mul_classical.c — Re-examine the dimension thresholds here after the
vec_dot changes.
nmod_vec_mul.c — Try delaying the modular reductions in the
matrix-vector product.
nmod_mpoly
div.c, divrem.c, divrem_ideal.c — These entry points fall back on a
path flagged as unfinished; implement proper algorithms.
divides_heap_threaded.c, mpolyn_divides_threaded.c — The thread-safe
append relies on x86 store ordering; add explicit memory barriers for weakly
ordered architectures.
gcd_zippel.c — Instead of increasing the extension degree on every
failure, try to find more irreducibles of the same degree first.
gcd_zippel.c, mpolyn_gcd_brown.c — The same prime-selection issue
recurs in the multivariate Zippel and Brown large-prime loops.
gcd_zippel2.c — Do not necessarily increase the degree at this point in
the large-prime GCD loop.
mpolyu.c — Determine whether these conversion functions are still used;
remove them if not.
sort_terms.c — Radix sort recursion depth is proportional to
N*FLINT_BITS; consider an iterative version.
nmod_mpoly_factor
factor.c — Use Kaltofen's leading coefficient reconstruction
(lcc_kaltofen).
n_bpoly_mod.c — Speed up n_bpoly_mod_mul_series.
n_bpoly_mod_factor_smprime.c — Port this Zassenhaus lifting precision
strategy to the other bivariate factorers.
nmod_poly
nmod_poly.h — Implement the commented-out mulmod precondition
strategies NMOD_POLY_MULMOD_PRECOND_SPARSE and ..._FFT.
nmod_poly.h — Move these matrix-related declarations to nmod_mat.h.
berlekamp_massey.c — Both reduction branches are always valid; find the
right cutoff between them.
compose_mod_brent_kung_vec_preinv.c,
compose_mod_brent_kung_vec_preinv_threaded.c — Precompute the powers of
h once for repeated rectangular splitting instead of recomputing per call.
divides.c, mullow_classical.c — Make the classical multiplication
check use nmod_vec_dot more directly.
divrem_newton_n_preinv.c — Tune the sparse-divisor cutoff; it should
depend on both the operand lengths and the modulus.
divrem_newton_n_preinv.c — Optimize the sparse path for common
coefficient combinations (1, -1, and others).
divrem_newton_n_preinv.c — Make the sparse division work in place.
evaluate_geometric_nmod_vec.c — Optimize the middle product used here;
it is often excellent but the fft_small variant is still needed.
gcdinv.c — Use nmod_poly_init_preinv here to reuse the already
computed inverse.
geometric_progression.c — If precomputation cost matters: extrapolate
may benefit from n_mulmod_shoup, the interpolate variant is not fully
Shoup-ified, and unrolling may help.
hgcd.c — The half-GCD implementation happens to support aliasing, but
callers should not rely on it; document or enforce.
minimal_irreducible.c — Refine and extend the table of minimal
irreducible binomials.
mullow_fft_small.c — The norm bounds are pessimistic for very
unbalanced products; split the larger polynomial into chunks instead.
mullow_fft_small.c — Consider combining a 1-norm bound with an inf-norm
bound (Young's inequality): faster to evaluate than Cauchy–Schwarz, though
typically less tight.
mulmod_precond.c — Implement a genuine sparse method here rather than
relying on _nmod_poly_divrem_newton_n_preinv's sparse special case.
mulmod_precond.c — Avoid zero-padding when alen < n, and note that
the quotient is only needed to precision n - 1, so one fewer coefficient is
required.
nmod_poly_factor
is_irreducible.c — Determine whether eliminating low-degree factors
beyond linear ones is worthwhile in the trial division test.
is_irreducible.c — Use multipoint evaluation when the modulus is large
enough.
is_irreducible.c — Use a sparse algorithm when the polynomial is
sparse.
nmod_poly_mat
print.c — Add pretty-printing (named variable, aligned entries) to
nmod_poly_mat_print.
padic
exp_balanced.c — Take advantage of additional factors of p in the
argument x in the balanced exponential.
exp_rectangular.c — Improve the division by the factorial in the
rectangular splitting exponential.
log_satoh.c — Improve the heuristic that suggests the valuation used in
Satoh's logarithm algorithm.
padic_mat
add.c — _padic_mat_add should use the precision of the inputs rather
than reducing at the output precision.
padic_poly
compose.c, compose_pow.c, evaluate_padic.c — This shared block of
p-adic arithmetic is duplicated in three files; move it into the padic
module.
inv_series.c — Explain why this particular Newton iteration gives the
expected result for non-normalized input (reducing coefficients mod N first
makes the tests fail, so _fmpz_mod_poly_inv_series cannot be used).
shift_left.c, shift_right.c — Reduce the result after shifting rather
than leaving it unreduced.
test/t-compose_pow.c — Confirm that initializing the test polynomial
with precision WORD_MAX is valid.
padic_radix
padic.c — Depending on operand sizes, the exactness test in division
may be cheaper as a Hensel division with remainder (radix_divmod_bn with
non-NULL rem) than as a Euclidean division.
padic.c — Optimize padic_radix_inv.
perm
perm.h — _perm_compose_inv1 allocates a temporary buffer
unconditionally; avoid it when the inputs do not alias.
qadic
qadic.h — These functions have names that do not use the qadic module
prefix; consider renaming them.
norm.c — Repeat the timing experiments that set the analytic-versus-
resultant crossover for p = 2, an important special case.
norm_resultant.c — This branch is untested because the standard
contexts always use Conway polynomials; add coverage with a custom modulus.
sqrt.c — Find a better way to fold the squareness check into the
computation of the square root itself.
test/t-sqrt.c — Unexplained marker on the qadic_randtest_val call;
clarify what needs checking about the chosen valuation range.
qqbar
cmp_re.c — Tune the algorithm cutoff based on the degrees and bit sizes
of the operands.
cmp_re.c — Reuse the improved enclosures already computed during the
comparison.
cmp_re.c — Determine when it is better to compute and compare the real
parts directly.
get_acb.c — Special-case quadratics, particularly Gaussian rationals,
when converting to acb.
get_fexpr.c — Extend the fast root-of-unity detection to rational
multiples of roots of unity.
get_fexpr.c — Consider allowing deflation to recurse in some cases,
with appropriate safeguards.
get_fexpr.c — Consider always setting the GAUSSIANS/CYCLOTOMICS
flags so roots of unity are expressed explicitly.
get_fexpr.c — Consider allowing separation to recurse, e.g. when the
degree has strictly decreased.
pow.c — Extend the fast path for roots of unity in qqbar_pow_ui to
rational multiples of roots of unity.
roots_poly_squarefree.c — Several improvements to root-finding for
polynomials with algebraic coefficients: support squareful polynomials
directly; use the quadratic formula for quadratics; compute tighter
denominator bounds or rescale for smaller coefficients; exploit coefficients
lying in a small common number field to reduce the degree; determine whether
exact verification ever beats numerics; and guess low-degree roots with LLL
to remove them before the full computation.
roots_poly_squarefree.c — Copy the original enclosures and reuse them
for refinement instead of recomputing.
write.c — Document, unify and generalize the qqbar printing code; it
is currently shaped only for the Python interface, but other wrappers need it
too.
radix
div.c — Zeroing the low limbs of the quotient can be optimized away.
div.c — Choose the initial approximation T so that T*A' <= 1 always
holds, removing the need for the sign check.
div.c — Use the unbalanced division algorithm from radix_divrem in
radix_divrem_preinv too.
init_clear.c — Optimize the division in _radix_val_pow2.
integer.c — Optimize radix_integer_cdiv_qr.
invmod_bn.c — Consider storing a dynamic table in the radix context
object rather than recomputing it.
invmod_bn.c — Tighten the allocation for the case where a mulhigh is
always used.
rsqrtmod_bn.c — _radix2_rsqrtmod_bn may use one extra limb
internally; confirm the caller's buffer accounts for it.
sqrt.c — Reduce the temporary space used by radix_rsqrt_1_approx.
thread_pool
find_work.c — The work-stealing counter can overflow in extreme cases
(low priority).
ulong_extras
CRT.c — Improve the implementation of n_CRT.
factorial_mod2_preinv.c — Add a faster path for n around
sqrt(UWORD_MAX).
ll_is_prime.c — Determine whether the 2^192 / m precomputation can
beat mpn_tdiv_qr.
ll_is_prime.c — Try to prove that the conditional correction in
n_ll_small_reduce2_precise is needed at most once.
ll_is_prime.c — The first two powmod rounds skip reduction when b^7
fits in a limb; one more round may be possible with a two-word result.
ll_is_prime.c — Implement a reasonable 64-bit primality test for the
double-limb powmod path rather than deferring to the general code.
ll_is_prime.c — n_ll_le mocks up double-limb comparison; replace it
once a proper double-limb type is available.
test/t-factor_lehman.c — This case was added as a regression test for
an unidentified bug; document which bug it covers.
Build system and CI
Makefile.in — Detect the number of available cores via autoconf
(equivalent of nproc) instead of defaulting to NJOBS := 8 when -j is
given without a number.
Makefile.in — Remove the hardcoded fq_zech_vec special case from the
test source discovery.
configure.ac — Extend the processor detection check to cover more CPU
models.
.github/workflows/release.yml — Add a make install smoke test to the
release workflow.
.github/codecov.yml — Raise the coverage target range from 70–95 to
roughly 90–95.
Documentation
doc/source/ca.rst — Document (and implement) coercion of a ca element
to a low-degree cyclotomic field where possible, alongside the existing
quadratic case.
doc/source/gr_generic.rst — Move the generic special function
documentation (Bernoulli, Euler, Stirling) to the gr_special section.
doc/source/gr_generic.rst — Move the generic vector method
documentation to the gr_vec section.
Examples
examples/mfcoefs.c — Handle the space character when parsing the
character/form specification.
examples/mfcoefs.c — This step may be skippable depending on the form;
determine when.
examples/mfcoefs.c — Only prime indices are needed in this loop;
restrict it accordingly.
Python interface
src/python/flint_ctypes.py — Unexplained marker in _gr_set_int where
xvec and yvec are aliased to the same vector; verify this is intentional.
src/python/flint_ctypes.py — gr_series coefficient access goes
through gr_poly_get_coeff_scalar; add a proper gr_series method.
src/python/mpmath2.py — RFContext.arg should use the math2
implementation.
I asked the AI to extract TODOs from comments in the source. We should decide whether we want to make this a new
TODO.md, convert to issues, leave somewhere else in one place (e.g. this issue), or ignore.AI output below:
TODO
Tasks extracted from
TODO/FIXME/XXXcomments in the FLINT source tree(
mainbranch, commit58030f4). Each entry is a rewritten, self-containeddescription of the task. Files are named without line numbers, which go stale
quickly; grep the named file for the marker to find the original comment.
Excluded from this list: vendored upstream files (
config/config.guess,config/configfsf.*,COPYING, and the GMP-derivedFIXMEs inacinclude.m4) and changelog prose indoc/source/history.rst.acb
dot.c— The cutoff for switching to the Gauss complex multiplicationtrick in the dot product could be lowered, but it currently competes with
mulhigh in the Karatsuba range; retune once that interaction is understood.
acb_calc
integrate_taylor.c— Inacb_calc_integrate_taylor, consider makingthe interval midpoint exact and folding the resulting displacement into the
error term for
x.integrate_taylor.c— Usearfarithmetic rather than machinearithmetic when computing the step size, to avoid overflow.
integrate_taylor.c— Judge convergence by relative rather than absoluteaccuracy, e.g. by inspecting the magnitude of
f(m).acb_dirichlet
arb_quadratic_powers.c— Baby-step giant-step could reduce the cost ofcomputing the vector of quadratic powers to
nvmultiplications.gauss_sum.c—acb_dirichlet_gauss_sumfactors the conductor eventhough the subsequent
factorcall repeats the work; drop the redundantfactorization.
isolate_hardy_z_zero.c—extend_to_prev_good_gram_nodeguards againstarb_get_lbound_arfreturning a negative bound for a nonnegative input.Determine whether that can ever happen; if not, delete the function.
jacobi_sum_factor.c— Use an efficient subgroup enumeration instead ofthe current approach when factoring Jacobi sums.
jacobi_sum_factor.c— Work out the Gauss sum relations for prime powersp^ewithe > 1so that this case can be handled too.l_fmpq_afe.c— Implement decomposition into primitive characters sothat
acb_dirichlet_l_fmpq_afesupports imprimitive characters.qseries_arb.c,qseries_arb_powers.c— The q-series summation runs atfull precision throughout; reduce the working precision as the terms decay
(per step in the
_powersvariant).secondary_zeta.c— Decide whether the thread-local cache of Hardy Zzeros should be exposed as public API for other callers.
secondary_zeta.c— Track a separate precision per cached zero insteadof one precision for the whole cache.
secondary_zeta.c— Implement refinement of already-cached zeros; thisis much cheaper than re-isolating each zero from scratch.
theta_arb.c— Tune the character-order cutoff (currently 30) thatselects between the small-order and naive theta series algorithms.
vec_mellin_arb.c— Truncate the working length inacb_dirichlet_vec_mellin_arbas terms become negligible.acb_elliptic
pi.c— Exact argument reduction inacb_elliptic_pi_inccan landexactly on a branch cut when
re(phi) = k/2, giving wrong results; handlethis case.
acb_hypgeom
2f1.c— Inspect the flags for integerc-aandc-beven whencisinexact, so those cases can use the specialized code paths.
airy_bound.c— Extendacb_hypgeom_airy_boundto also provide boundsfor real
z >= 0.bessel_j.c— Generalize the derivative bound forJ_nu(z)beyond thecurrently supported low orders.
bessel_j.c— Extend the hardcoded table used for the commonly neededderivative bounds.
bessel_j.c— The cancellation estimate for the transition region iscrude; estimate it more accurately for large
nu.bessel_j.c— Find a cleaner way to fall back on direct magnitude boundsfor wide inputs, ideally by detecting wide intervals up front rather than
after the enclosure comes out useless.
gamma.c— Improve the bound computation used inacb_hypgeom_rgamma.m.c— Inacb_hypgeom_m_choose, estimate the extra working precisionneeded for large
minstead of using a fixed guess.pfq_series_sum.c— Tune the rectangular-splitting versus basecasechoice for larger series lengths.
pfq_series_sum.c— Consider using binary splitting whennis largeenough, for better numerical stability.
pfq_series_sum_bs.c— When a pole falls near the end of the summationrange, use the fast algorithm for the start or middle segment and the
basecase algorithm only for the tail.
test/t-2f1.c— Add test coverage for thea-candb-cinteger casesonce they are implemented.
acb_mat
approx_eig_qr.c— Two items inherited from the mpmath original this wasported from: implement balancing, and implement aggressive early deflation.
eig_enclosure_rump.c— The nonnegative eigenvalue bound uses a Perronroot bound; add a direct formula for the
k = 2case.eig_enclosure_rump.c— Consider lowering the working precision of theeigenvalue bound when the requested precision is very high.
eig_enclosure_rump.c— Determine and document a reasonable iterationcount for the Rump enclosure loop instead of the current ad hoc value.
eig_enclosure_rump.c— Likewise, determine a principled size for theinflation epsilon.
eig_enclosure_rump.c— Consider inflating the candidate matrixYelementwise rather than uniformly.
acb_poly
acb_poly.h— Document_acb_poly_binomial_pow_acb_series,_acb_poly_acb_pow_cpxand_acb_poly_acb_invpow_cpx.div_root.c— Avoid the extra assignments in_acb_poly_div_rootwhilestill supporting aliasing of input and output.
divrem.c— Tighten theacb_polydivision-with-remainder code(allocation and precision handling).
gamma_series.c— Precomputez^2in the binary splitting recursioninstead of recomputing it at every node.
gamma_series.c— Usediv_seriesinstead of the current approach whenthe rising factorial is short, once
div_serieshas a good basecase.polylog_series.c— Handle the cases where|Li_s(z)|is very small orvery large specially when choosing the number of terms.
polylog_series.c— Add a cosecant function so this code does not haveto build it from sine and division.
polylog_series.c— Allow threading in_acb_poly_polylog_cpx_small.rgamma_series.c— Consider usingdiv_serieshere once it has a goodbasecase.
test/t-atan_series.c— The test does not check the first coefficient ofthe result; extend it to do so.
test/t-find_roots_cd_poly.c— Make the tested function return/add aradius so the enclosure can be checked.
zeta_em_bound.c— The bound usesatanwhere a simple bound bypi/2would also apply and be cheaper; combine the two.
zeta_em_bound.c— Only an upper bound on the product is needed; write adedicated function instead of computing the full product.
zeta_em_sum.c— The deflated Euler–Maclaurin sum is numericallyunstable for high derivatives and divides by zero when
scontains 1. Find astable way to evaluate
((N+a)^y - 1)/yforywith nonzero constant termwithout dividing.
zeta_em_tail_naive.c— Combine this multiplication with the precedingone to save work.
acb_theta
ql_jet_fd.c— Adjust the working precision so that2^(-prec)roughlymatches the computed error bound, rather than keeping the input precision.
siegel_reduce.c— Choose the precision used for the infinity-norm boundof the reduction matrix more carefully.
arb
exp_taylor_rs.c— Consider dropping the evenness assumption in therectangular splitting scheme, since sign issues do not arise here.
exp_taylor_rs.c— Doing so requires fixing the construction of thepowers below that point.
gamma.c— Verify (or assert) the assumptionn >= 1inacb_gamma_bound_phase.hypot.c— Usearb_fmmafor the fused multiply-add inarb_hypot.sin_cos_wide.c— The double-precisionsin_coshelper is thebottleneck of wide-interval trigonometry; write an mpn version.
arb_calc
refine_root_bisect.c— Refactor and share code betweenrefine_root_bisect.candisolate_roots.c.refine_root_bisect.c—arb_calc_partitionalways splits at themidpoint; experiment with other split points.
arb_fmpz_poly
real_roots.c—fmpz_poly_isolate_real_rootsusually detects exactroots landing on bisection points, but its contract does not guarantee it.
Add explicit checks here to prevent potential hangs.
arb_hypgeom
erf.c— Allow a precomputedGamma(a)to be passed into the bit-burstcomputation of the incomplete gamma function.
erfinv.c— Use a good direct approximation forerfcinvinstead of thecurrent fallback in
arb_erfinv_approx_huge.gamma_upper_fmpq_step_bsplit.c— Find a clean way to emit thisdiagnostic message through
flint_throw.arb_poly
div_root.c— Avoid the extra assignments in_arb_poly_div_rootwhilestill supporting aliasing.
divrem.c— Tighten thearb_polydivision-with-remainder code.gamma_series.c— Precomputez^2in the binary splitting recursion.gamma_series.c— Preferdiv_serieswhen the rising factorial isshort, once
div_serieshas a good basecase.mullow_block.c— Only write and use the double approximations when theblock is short enough for them to pay off.
mullow_block.c— Fuse this two-step conversion into a single operation.rgamma_series.c— Evaluate whetherdiv_seriesis preferable here,once it has a good basecase.
test/t-atan_series.c— The test skips the first coefficient of theresult; extend it to check that too.
arf
add.c— Decide whether top-aligning theslongoperand inarf_add_siis worth the extra work.
add_mpn.c— Add a fast path forshift == 0in_arf_add_mpn; this isthe common case.
mul_rnd_down.c— The limb-count cutoff for delegating to MPFR is aplaceholder; determine proper cutoffs.
submul.c— Makearf_submul_mpzmore efficient than the currentconvert-then-submul approach.
arith
dedekind_cosine_sum_factored.c— The factored Dedekind cosine sum hasnot been tested on 32-bit platforms; do so.
divisors.c—arith_divisorsdoes not check for overflow of thedivisor count for huge
n; add the check.ramanujan_tau.c— Handle overflow properly in the multiplicativereconstruction of
tau(n)from its factorization.bernoulli
fmpq_ui_multi_mod.c— Optimize the CRT basecase used when combiningBernoulli number residues.
ca
ca_types.h—ca_types.hincludes all offmpz_mpoly.honly forfmpz_mpoly_vec_struct; move that struct tofmpz_types.hinstead.ca_types.h— Remove theqqbar.handnf_elem.hincludes fromca_types.h.check_ge.c— For comparisons that cannot be decided directly, considersubtracting and computing the sign; symbolic cancellation may resolve more
cases.
check_is_zero.c— Factor out monomials before testing for zero.check_is_zero.c— Also remove the content of the expression beforetesting.
conj.c— Add dedicated handling for conjugation ofCA_Conjugate,CA_Signand similar extension functions.conj.c— Conjugate purely imaginary quantities by negating them insteadof building a new expression.
conj.c— Consider re-evaluating functions under conjugation, allowingnew objects to be inserted into the field.
conj.c— Decide whenca_conj_deepshould conjugate an extensionnumber directly rather than going through
ca_set_qqbarfor its rewriting.get_fexpr.c— Replace the chain of comparisons for named constants witha lookup table.
log.c— Extend fast detection of roots of unity inca_logto elementsof number fields and other representations.
pow.c— Special-case all roots of unity inca_pow_fmpz, not just thecurrently handled ones.
set_qqbar.c— Use a fast search table when looking up an existingqqbarfield in the context.ca_field
build_ideal.c— Separate positive and negative exponents when provinglogarithmic relations, avoiding the inverses.
build_ideal.c— Avoid duplicating these computations when provingmultiplicative relations.
build_ideal.c— Handle more special cases (including roots of unity)when inserting multiplicative relations.
ca_mat
find_pivot.c— Support in-place simplification of entries during theexpensive second pivot search pass, so the work is not thrown away.
mul.c— Tune the algorithm selection inca_mat_mulfor entry degreeand bit size.
right_kernel.c,rref_fflu.c,rref_lu.c— These loops handle aT_UNKNOWNresult that should not arise; save the pivot data from the LUstep so the outcome is known.
rref_lu.c— Add a fast path for single-row matrices.ca_poly
div_series.c— Also take the inversion-based branch when inversionalone is fast and the numerator length is small.
mullow.c— Handle mixed cases (operands in different representations)in
_ca_poly_mullow_fmpqs.mullow_same_nf.c— Inspect the actual elements to derive degree boundsrather than using worst-case bounds.
calcium
calcium.h—calcium_write_freeduplicates functionality; removeeither it or
truth_printlningr.h.dirichlet
chi_vec_primeloop.c— Reuse the precomputed discrete logarithm dataalready present in the prime structure, if available.
dlog
rho.c— The general Pollard rho discrete log algorithm hangs; fix it.vec_eratos_add.c— Sieving bym*p^ecould be faster, but the relationv[p*m] = v[p]*v[m]does not apply; find a workable formulation.vec_sieve.c,vec_sieve_precomp.c— Tune the crossover betweendiscrete logarithm and index calculus methods.
vec_sieve.c— The sieve limit is hardcoded to 50; tune it.fexpr
fexpr.h— Work around the circular include:ca_types.hneedscalcium_stream, butqqbar.hdefinesfexpr_t-based functions only whenFEXPR_His defined, which is true beforefexpr_titself exists.set_fmpz_mpoly.c— UnexplainedFIXMEinfexpr_set_fmpz_mpoly;determine what is wrong with the term-construction branch and fix it.
write_latex.c—fexpr_write_latex_matrixhandles row grouping but notcolumns; add column handling.
fft_small
mulmod_satisfies_bounds.c— Complete the analysis of truncated reversebutterflies for 50-bit primes, proving the output stays in
(-2n, 2n)whenever the input does.
nmod_poly_mul.c— Consider storingbnand the minimum ofan, bninthe precomputed structure, in case they are much smaller than
an.fixed
exp_bitwise_rs.c— The lastarbdependency in this tier is theseven-logarithm prime-vector combination used for
i <= 6; replace it withnative fixed-point code.
sin_cos_bitwise_rs.c— Likewise, the remainingarbdependency here isthe Gaussian-prime vector combination for
i <= 3.fmpq_mat
get_fmpz_mat_mod_fmpz.c— Clear denominators up front to avoid repeatedexpensive modular inversions.
set_fmpz_mat_mod_fmpz.c— Handle special cases (zeros, small integers)efficiently during rational reconstruction.
solve_dixon.c,solve_multi_mod.c— The modulus bound assumesnumerator and denominator bounds are comparable; when one is much smaller, a
tighter bound (
2ND) can be used.test/t-inv.c,test/t-solve.c,test/t-solve_dixon.c,test/t-solve_fmpz_mat.c,test/t-solve_fmpz_mat_dixon.c,test/t-solve_fmpz_mat_fraction_free.c,test/t-solve_fmpz_mat_multi_mod.c,test/t-solve_fraction_free.c,test/t-solve_multi_mod.c— These testsbuild nonsingular random matrices inline; replace the ad hoc loop with a
proper
randtestfunction.fmpq_poly
div.c,divrem.c,rem.c— These routines compute a fullquotient/remainder where only part is needed; avoid the unnecessary work.
divrem.c,rem.c— Confirm that allocatinglenAcoefficients for theremainder is really required, and tighten if not.
interpolate_multi_mod.c— Once a good coefficient bound is available,stop overshooting the number of CRT primes.
invsqrt_series.c— Determine whether the finalfmpq_poly_canonicalisecall is necessary.
io.c,set_str.c— Remove these deprecatedmpq_t-array helpers andthe legacy string parsing entry point.
mul.c— When the contentgcd1/gcd2is large relative to thepolynomial degrees, divide out common factors before multiplying rather than
after.
rem_powers_precomp.c— Them >= 2*nbranch does not use theprecomputed powers; make it do so.
fmpz
bin_uiui.c— Add a fast path for smalln, kin the binomialcoefficient.
CRT.c—_fmpz_CRTassumesr1has been reduced into[0, m1);document and add tests covering this precondition.
fdiv.c— Speed upflint_mpn_divrem_preinvnenough that thespecial-cased small-remainder branch can be dropped.
gcd.c— Callmpn_gcddirectly to avoid redoing normalization workalready performed by
fmpz_gcd.link/fmpz_gc.c—_fmpz_cleanup_mpz_contentleaves stale entries inmpz_arr; remove the freed entries and compact the array.fmpz_factor
ecm.c— Consider delaying promotion of the found factorfuntil afterthe stage 2 precomputations are complete.
factor.c,factor_trial.c,factor_trial_range.c— When the calleronly needs squarefree-ness (Möbius function and similar), abort as soon as a
repeated factor is found instead of completing the factorization.
fmpz_lll
check_babai_heuristic.c— The norm helper usesDBL_MINas a thresholdin a questionable way; establish a correct bound.
check_babai_heuristic.c— Consider converting the multiplier to anexact integer when working at high precision.
check_babai_heuristic.c— Alternatively, makenfloatdetect smallmultipliers and take a fast path.
is_reduced_mpfr.c,is_reduced_mpfr_with_removal.c— The MPFR codestores
Qtransposed so vector operations apply; apply the same optimizationto the double-precision code.
is_reduced_mpfr.c,is_reduced_mpfr_with_removal.c— Replace thescalar loops in these checks with dot products.
is_reduced_mpfr_with_removal.c— The original MPFR code did not specifya rounding mode here; confirm that the chosen mode is correct.
test/t-lll.c— Under the current definition offmpz_mat_is_reduced,this input counts as unreduced; decide whether the definition or the test is
wrong.
fmpz_mat
fmpz_mat.h—fmpz_mat_CRT_uiavoidsfmpz_combfor small inputsbecause its basecase is poor; improve
fmpz_combso the workaround can go.hnf.c— Dispatch to the Micciancio–Warinschi or Pauderis–StorjohannHermite normal form algorithms once they are implemented.
is_reduced.c,is_reduced_with_removal.c— For very small matrices,use a division-free algorithm over Z instead of working over Q.
is_reduced.c,is_reduced_with_removal.c— Neither reducedness checkis tuned at all; establish sensible cutoffs.
mul.c— For very large dimensions (over ~10000), consider callingStrassen directly to reduce memory use.
mul.c— Retune the FFT-based multiplication cutoff for squaring, andpossibly for BLAS-backed builds.
permanent.c— For non-uniform matrices, use rowwise or columnwise entrybounds, which can be tighter than a single matrix-wide bound.
permanent.c— Make the algorithm cutoff depend on the entry bit sizeAbits.solve_dixon.c— When the numerator and denominator bounds differgreatly, a tighter modulus bound (
2ND) can be used.test/t-rref_mul.c— Determine whether the returned denominatorden2is ever legitimately zero, and tighten or remove the guard accordingly.
fmpz_mod_mpoly
buchberger_naive.c— Exponent vectors are packed one per word; usetighter packing for small exponents, given a guarantee on the exponent range.
fmpz_mod_mpoly_factor
bpoly_factor_smprime.c— Port this bivariate lifting precision strategyto the other bivariate polynomial factorers.
factor.c— Use Kaltofen's leading coefficient reconstruction(
lcc_kaltofen) in the irreducible-factor path.fmpz_mod_bpoly.c— Speed upfmpz_mod_bpoly_mul_series.fmpz_mod_poly
berlekamp_massey.c— Both reduction branches are always valid; find theright cutoff between them.
berlekamp_massey.c— Get the half-GCD algorithm working in this branch.inlines.c— Move these inline function definitions out into their ownfiles.
inv_series_newton_f.c,radix.c—_fmpz_mod_poly_inv_seriesnolonger accepts a precomputed inverse leading coefficient; add back a variant
that does, so these callers stop recomputing it.
fmpz_mod_poly_factor
factor_kaltofen_shoup.c— The threaded and non-threaded distinct-degreefactorization paths duplicate a lot of code; merge them.
factor_squarefree.c— Unexplained conversion of the modulus to a singleword; determine whether this is correct for large moduli.
fmpz_mpoly
buchberger_naive.c— Use tighter exponent packing for small exponentsinstead of one word per exponent.
div.c,divrem.c,divrem_ideal.c,quasidiv.c,quasidivrem.c,quasidivrem_ideal.c— These entry points fall back on a generic pathflagged as unfinished; implement proper dedicated algorithms.
divides_heap_threaded.c—fmpz_mpoly_ts_appendrelies on x86 storeordering; add explicit memory barriers so threaded division is correct on
weakly ordered architectures (see the fix already applied in
gr_mpoly).fit_length_reset_bits.c— Decouple the coefficient and exponentallocations, as already done in
nmod_mpolyandfq_nmod_mpoly.mul_monomial.c— Once the exponent/coefficient allocations aredecoupled, move this routine into the generic
mpolymodule.sort_terms.c— The radix sort recursion depth is proportional toN*FLINT_BITS; consider an iterative version (low priority).sqrt_heap.c— Port the small-coefficient (nofmpzarithmetic)strategy used here to the other
fmpz_mpolymultiplication and divisionroutines.
symmetric.c— Generating combinations uses Knuth's algorithm L;algorithm T is faster.
to_from_fmpz_poly.c— Handle multiprecision exponents in the conversionbetween
fmpz_mpolyand univariatefmpz_poly.fmpz_mpoly_factor
gcd_algo.c— When picking the main variable, take the expected degreeof the GCD into account, and add a size limit to
univar_pseudo_gcdsorunaway coefficient growth aborts the attempt.
gcd_algo.c— Algorithm selection is incomplete: a single-bitMPOLY_GCD_USE_*value should force exactly that algorithm, and a multi-bitvalue should choose among the set bits.
gcd_algo.c— Add a bivariate heuristic to the small-input GCD path.gcd_zippel.c— Add a divisibility test here when the coefficients aresmall enough for it to be cheap.
irred_zippel.c— The divisibility precondition in_fmpz_mpoly_modpk_taylor_coeffis only asserted, not handled; make the coderobust.
lcc_kaltofen.c— The lifting code works formvars = 1but goesthrough the general path; consider a dedicated special case.
fmpz_poly
bit_unpack.c—fmpz_poly_bit_unpackallocates and copies far morethan necessary; rewrite it to avoid the waste.
interpolate_multi_mod.c— With a good coefficient bound available, stopovershooting the number of CRT primes.
pseudo_divrem_divconquer.c— This branch silently assumes the inputAmay be modified in place; document or enforce that contract.
sqrt_divconquer.c,sqrtrem_divconquer.c— Implement the middleproduct so the Hanrot–Quercia–Zimmermann
Sqrtfunction (which needs it) canbe used.
fmpz_poly_factor
inflation_is_irreducible_capelli.c— Make thep = 2Capellicertificate two-sided for
deg T >= 3by explicitly reconstructinggammawith
gamma^2 = thetainK = Q[y]/(T): take componentwise square roots ata prime minimizing the local factor count, Hensel-lift, and resolve the sign
ambiguity.
fmpz_poly_mat
test/t-sqr_KS.c— Add separate tests for the unsigned Kroneckersubstitution variant.
fmpz_poly_q
div.c,sub.c— These functions duplicate logic that already exists inthe multiplication and addition code; share it instead of maintaining two
copies.
div.c— Verify that the numerator carries the correct sign aftercanonicalisation.
fmpz_vec
multi_CRT_ui.c— Port the optimizations already used in thefmpz_matmulti-modular CRT code to the vector version.
fq
ctx_init.c— Add coverage for very large primes in the contextinitialization tests.
inlines.c— Remove this compatibility shim.norm.c— The non-Conway branch of_fq_normis untested because thestandard contexts always use Conway polynomials; add a test with a custom
modulus.
norm.c— Make the modulus polynomial monic before computing theresultant-based norm.
pow_ui.c— Optimizefq_pow_ui; it currently uses a naivesquare-and-multiply.
fq_default_mat
fq_default_mat.h— Add matrix reading (input) functions to match theexisting print functions.
fq_mat_templates
fq_mat_templates.h— Add matrix reading (input) functions to thetemplated finite field matrix interface.
mul_KS.c— Make Kronecker substitution multiplication generic byintroducing templated
bits_neededandbit_packoperations.fq_nmod
io.c—fq_nmod_ctx_fprintneeds work (formatting and error handling);the comment is unexplained.
norm.c— The non-Conway branch of_fq_nmod_normis untested; addcoverage with a custom modulus.
norm.c— Make the modulus polynomial monic before the resultantcomputation.
pow.c— Move the windowed exponentiation helper into its own functionand optimize it.
pth_root.c— Use modular composition to compute thep-th root insteadof the current approach.
reduce.c— Merge this reduction code with_nmod_poly_divrem_try_sparse.fq_nmod_mpoly
fq_nmod_embed.c—bad_n_fq_embed_sm_to_lgallocates a localn_poly_stack_t; pass the caller's stack in instead.gcd_zippel2.c— Promote this helper to a realfq_nmod_mpolyn_interp_mcrt_lg_mpolyimplementation.sort_terms.c— Radix sort recursion depth is proportional toN*FLINT_BITS; consider an iterative version.sqrt_heap.c— Use_n_fq_dot_lazy_sizeto choose the lazy reductionsize instead of the current fixed choice.
fq_nmod_mpoly_factor
factor.c— Use Kaltofen's leading coefficient reconstruction(
lcc_kaltofen).n_bpoly_fq_factor_lgprime.c— Remove thempoly_ctx_tparameter fromthe
bad_fq_nmod_mpoly_embed_chooserinterface; it is not needed.n_bpoly_fq_factor_smprime.c— Implement CLD (coefficients of thelogarithmic derivative) bounds to prune the recombination search.
fq_poly_factor_templates
factor_equal_deg_prob.c— The exponentd * ctx_degreecan overflow;detect and handle it.
fq_poly_templates
io.c— When a coefficient has only one nonzero term, omit thesurrounding parentheses when pretty-printing.
fq_zech
pow.c— Move the exponentiation loop into a separate function andoptimize it.
set_fmpz.c— Clean up the conversion fromfmpztofq_zech.fq_zech_mpoly
get_set_nmod_mpoly.c— Move this conversion helper to a moreappropriate module and make it faster.
fq_zech_mpoly_factor
bpoly_factor_smprime.c— Implement CLD bounds for the bivariate factorrecombination.
factor.c—fq_zech_mpoly_factor_algocurrently delegates everythingto
fq_nmod; give it a native implementation.generic_files
io_vprintf_impl.h— Add options for compact versus spacious printing ofpolynomials.
io_vprintf_impl.h— Move these type-specific print helpers into theirrespective modules.
io_vprintf_impl.h— Let callers pass a precision to thearb-familyprinting functions.
io_vprintf_impl.h— Add an option to print numbers in a base other than10.
io_vprintf_impl.h— Add non-compact printing, with options for variableindentation and aligned columns.
io_vprintf_impl.h— Square brackets delimit both vectors/matrices hereand
arb_get_stroutput; decide whether to change one of them.io_vprintf_impl.h— Allow the generator symbol used when printingpolynomials to be specified.
io_vprintf_impl.h— If terminal width and height can be detected, elidethe middle of long vectors, matrices and polynomials by default (as Julia
does).
gr
gr_types.h— Replace this local attribute macro withFLINT_WARN_UNUSED.fmpq.c— Use the return value offmpz_rootin_gr_fmpq_pow_fmpz,and do the same in the
qqbarnth root code.fmpq.c— Handle mixed-representation cases in_gr_fmpq_poly_mulmid.fraction.c— Recognize other types with internal fractions (nf,fmpq_poly,fmpq_mpoly,Frac(R)[x], …) directly rather than goingthrough a generic conversion.
fraction.c— This fast branch in_gr_fraction_is_oneis notnecessarily faster than the general path; benchmark it.
fraction.c— Determine whether the special case in the early-reductionaddition is worth keeping.
polynomial.c— Account for sparsity when choosing a factoring strategyfor generic polynomials.
qqbar.c— Compute the squarefree factorization in the original ringbefore converting to
qqbar; this should generally be faster.test_ring.c— Work out how to test the_otheroperation variants incases where
set_otheritself fails.gr_generic
set_str_expr.c— Exponent parsing only accepts integer literals;support full expressions and rational exponents.
gr_mat
fflu.c— When the pivot element is known to be invertible, exploit thatinstead of taking the general division path.
func_jordan.c— Apply the same inexact-ring fallback (diagonalizationwith distinct eigenvalues) in
gr_mat_jordan_form.func_jordan.c— Find a better approach than falling back ondiagonalization for inexact rings.
gr_poly_solve_lode_newton.c— Introduce a Newton iteration contextstruct to carry
ZandA_denominator_invbetween steps.gr_poly_solve_lode_newton.c— Three full multiplications in_gr_mat_gr_poly_solve_lode_newton_stepshould be truncated multiplications(
mullow).gr_poly_solve_lode_newton.c— One product in_gr_mat_gr_poly_solve_lode_newton_stepshould be a middle product(
mulmid).gr_poly_solve_lode_newton.c— Compute only the high part of thederivative rather than the whole thing.
gr_poly_solve_lode_newton.c— Avoid the explicit shifts by computingonly the high part of the integral.
gr_poly_solve_lode_newton.c— Avoid copying the matrix at each Newtonstep.
gr_poly_solve_lode_newton.c— Add a basecase for short lengths insteadof recursing all the way down.
gr_poly_solve_lode_newton.c— Find a way to cacheA_denominator_invacross calls.
is_orthogonal.c— Over rings with coefficient explosion, compare twohalf-length products for negated equality instead of testing a full product
against zero.
jordan_transformation.c— Special-case eigenvalues of multiplicity 1 inthe block construction below, as is already done above.
jordan_transformation.c— Determine whether the eigenvector list builtin
gr_mat_jordan_transformationneeds to be sorted.mul_classical.c— Consider applying the same inlining strategy innonsingular_solveand related routines.mul_rosowski.c— The implementation uses 1-based indexing to mirror thesource paper; consider rewriting with 0-based indices.
mul_rosowski.c— Temporaries appear to be initialized even when theinner loops are never entered; avoid the waste.
nullspace.c,rref_fflu.c,rref_lu.c— AT_UNKNOWNresult shouldnot be possible when reading back pivots; save the pivot data from the
LU/FFLU step.
permanent.c— Generalizegr_mat_permanentto rectangular matrices;add an integer version optimized for small entries; support sign reversals in
the cofactor expansion so
gr_mat_det_cofactorcan share it; exploitsparsity; and parallelize the cofactor expansion.
rank.c— The LU versus FFLU choice needs tuning, especially where fastmatrix multiplication is available (
ca_matuses LU for number fields).rref_lu.c— Add a fast path for single-row matrices.test/t-gr_poly_solve_lode_newton.c— Use agr_ore_poly_tfor thetemporary polynomial instead of the current workaround.
gr_mpoly
ctx.c— Decide how to find inverses of nonconstant polynomials overnon-integral domains when building the generator list.
divides_heap_threaded.c— Port the release-fence guard added here tofmpz_mpolyandnmod_mpoly, where threaded division is currently disabledon ARM.
set_other.c— Replace the quadratic variable-name matching with afaster algorithm.
gr_poly
compose_mod_brent_kung.c,compose_mod_brent_kung_preinv.c— The codeassumes squaring is cheaper than multiplication, which is ring-dependent;
make the choice explicit.
compose_mod_brent_kung_precomp_preinv.c— Clarify why the row count ispassed separately rather than read from
A->r.compose_mod_brent_kung_precomp_preinv.c— Validate the dimensions ofthe precomputed matrix
A.div_series_newton.c— Tighten the allocations once a middle product isavailable.
gcd_hgcd.c,hgcd.c,resultant_hgcd.c— These half-GCD routineshappen to support aliasing, but no caller other than the top-level wrapper
should rely on it; either document the guarantee or remove the reliance.
inv.c—gr_poly_invmay wrongly returnGR_DOMAINfor nonconstantpolynomials over non-integral domains; compare against AbstractAlgebra's
behaviour.
mul_karatsuba.c— Add a self-recursive Karatsuba variant that reusesits scratch space.
mul_toom33.c— Add a squaring version of Toom-3.mul_toom33.c— Skip unnecessary zero-extension of the intermediatevectors and tighten the allocations.
mullow_bivariate_KS.c— Support base types other than the currentlyhandled ones in bivariate Kronecker substitution.
mullow_toom_serial.c— The interpolation matrix is built overctxitself; in some cases a subring or extension ring would be more appropriate.
mullow_toom_serial.c— Consider reciprocal evaluation points (1/2 etc.)for the
fmpz_matinterpolation variant; this should yield smallerdenominators.
mulmid.c— Write a real generic middle product; the current code justfalls back on
mullow.mulmod_preinv.c—_gr_poly_mulmod_preinvshould not require itsinputs to be already reduced.
newton_basis.c— Clarify whether thenparameter means degree orlength, and consider reordering the arguments to put
nbefore the basis.revert_series.c— Determine when squaring should be preferred forcomputing powers here and in
compose_series_brent_kung.tan_series.c— Make the choice between the exponential-quotient anddirect tangent methods precision-dependent, rather than always favouring the
former for large arguments.
gr_series
series.c— Add optimizations for the case of a length-1 denominator.series.c— Usegr_poly_series_divexactonce a non-basecaseimplementation exists.
series.c— Add a special case for a length-1 divisor.series.c— When the polynomials are short compared to the requestedprecision, try an exact polynomial division before falling back on power
series division.
gr_special
bessel_j_jet.c— Usegr_is_integerinstead of the current ad hocintegrality test.
bessel_j_jet.c— Handlegr_is_zero(z) == T_UNKNOWNvia Fungrim entry2488BB, which needs
gr_poly_binomial_transform(not yet implemented).fib.c— For huge numerical Fibonacci values, Binet's formula withexp/log should be faster than iteration.
fib.c— Apply a single iteration directly to the lookup table, asfmpz_fib_uidoes.fib.c— For exact infinite rings, callmpz_fib_uifornbelowroughly 10000;
fmpzalready overrides this butQQand others wouldbenefit too.
gr_vec
product.c— Implement algorithm selection in the generic vectorproduct.
sum.c— Implement algorithm selection in the generic vector sum: binarysplitting is needed for optimal complexity over fractions, so the cutoff
should be lower there without adding overhead for rings with cheap addition.
longlong
longlong.h— A workaround is in place for a code generation bug inClang 16 and later; revisit once the compiler bug is fixed.
mag
mag.h— Rename thesefmpzexponent helpers and move them tofmpz_extras.mag.h— Documentmag_get_d_log2_approx.mag.h— Add tests formag_bin_uiui,mag_bernoulli_div_fac_uiandthe functions declared after
mag_set_ui_lower.add.c— Combine these two rounding steps inmag_addinto one.root.c—mag_rootrewrites the argument asexp(log(1+2^(kn)x)/n) 2^-k; this rescaling is probably unnecessary with the current exp/logimplementations.
test/t-d_log_lower_bound.c,test/t-d_log_upper_bound.c,test/t-set_d.c,test/t-set_d_2exp_fmpz.c— These tests define a locald_randtest2becaused_randtestdoes not produce a good enough spread ofdoubles; improve
d_randtestand drop the duplicated helper.mpn_extras
mpn_extras.h— Add generic hardcodedmullowimplementations for thenon-assembly build path.
mpn_extras.h— The mulhigh/mullow tuning constants are calibrated forx86_64_adxwithfft_small; add tuning for other configurations.mpn_extras.h— The code assumes the same parameters are optimal forboth mulhigh and mullow; verify or split the tuning.
mpn_extras.h—flint_mpn_mul_or_mullow_nhas2nlimbs of scratchavailable; exploit this in the Mulders range by calling Mulders directly
instead of allocating.
divrem_preinvn.c,mod_preinvn.c— Add fixed-length code for smalln, use an unbalanced mulhigh in the second loop, and usemullow.mulmod_preinvn.c— Add fixed-length code for more smalln(notingthat
1x1cannot usenmod_mul, since the inverses are defineddifferently), and use
mullow.get_str.c— Improve the radix conversion code so it beats GMP in thefft_smallrange too, rather than delegating.mul_toom22.c— The unconditional call totoom32_mulguards againstgrowing unbalance; make it conditional on
MUL_TOOM33_THRESHOLD / MUL_TOOM22_THRESHOLDandMUL_TOOM22_THRESHOLD.mul_toom32.c— Consider keepingv1[2*n]andvm1[2*n]in scalarvariables rather than in memory.
mul_toom32.c— Usempn_add_n_sub_nfor the main part of thisinterpolation step.
mul_toom32.c— Eliminate the secondvm1_negconditional by swappingthe locations of the
+1and-1evaluation values.mul_toom32.c— Determine whether support fors + t == nis actuallyneeded.
arm64/mul_2.asm— Find a better asymptotic algorithm (currently only~8% faster than
mul_1 + addmul_1on M1), and avoid pushingr13to thestack.
x86_64/broadwell/mul_hard.asm— Replace the hardcodedflint_mpn_mul_M_Nvariants withflint_mpn_mul_M_ntakingnin aregister (
%rcx) to shrink the code; fix latencies; minimize 32-bit registerinstructions; and investigate partial stack storage instead of registers.
x86_64/broadwell/mulhigh_hard.asm— Interleave independent work toavoid latency penalties, and move 32-bit operations to
%rax–%rbpregisters to save encoding bytes.
x86_64/broadwell/mulhigh_normalised_hard.asm— Rewrite then = 6, 7, 8cases in the style already used forn < 6.x86_64/broadwell/sqrhigh_normalised_hard.asm— Use the sign flag fromadcinstead of an explicittest.x86_64/x86_64-defs.m4— TheLEAmacro should never need a GOT entry,so the simpler variant could always be used; first work out what happens for
not-yet-hidden symbols.
x86_64/broadwell/flint-mparam.h— Broadwell tuning parameters arecopied from the generic x86-64 file; measure and set real values.
x86_64/icelake/flint-mparam.h,x86_64/meteorlake/flint-mparam.h,x86_64/raptorlake/flint-mparam.h,x86_64/tigerlake/flint-mparam.h—These tuning parameters are copied verbatim from Skylake; measure each
microarchitecture.
x86_64/zen4/flint-mparam.h— Zen 4 tuning parameters are copied fromZen 3; measure them.
profile/p-mulhigh.c,profile/p-sqrhigh.c— Remove the temporary guardonce mulhigh/sqrhigh are fully implemented.
profile/p-mulmod_preinvn.c— The profiling harness usesprof_*routines that only exist on x86; provide them or guard the profile elsewhere.
tune/tune-mulhigh.c,tune/tune-sqrhigh.c— Remove the preprocessorconditional wrapping the tuning programs.
mpn_mod
mat_mul_waksman.c— The scratch limb count is sized for any unreducedvalue plus a sign bit; tighten this bound.
poly_mullow_fft_small.c— Count actual coefficient bits, so smallinputs get a cheaper transform size.
poly_mullow_karatsuba.c— Consider doing modular additions andsubtractions instead of widening the working limb count.
poly_mullow_karatsuba.c— The middle product accepts generalnlo/nhiranges but only saves work on reductions; make it actually skipthe unneeded multiplications.
mpoly
is_poly.c—mpoly_is_polycould be made faster.misc.c— Consider short-circuitingmpoly_monomial_msub_ui_arrayandmpoly_monomial_madd_ui_arraywhen the two exponent vectors are identical.n_poly
n_poly.h— UnexplainedFIXMEon_n_fq_mul_ui; determine what iswrong and fix or remove the marker.
n_fq_poly_divrem.c— Clarify whylenArather thanlenBis used herein the divide-and-conquer division.
nf_elem
equal.c— Only compute the GCD in the equality test when it is expectedto save time.
nfloat
nfloat.h— Decide whether special values are better encoded in theexponent field or the sign field.
nfloat.h— Decide whether to support signed zero, possibly as anoption.
complex.c— Optimize the rare branch of_nfloat_complex_sqr_standardas well.
dot.c— Stop relying onctx->sizeof_elemso real dot products can becalled from complex context objects.
dot.c— The final perturbation is accommodated by bumping the exponent;instead keep the exponent and check for overflow while performing the
perturbation.
dot.c— The error bound follows Theorem 7 of the reference paper;improve it for sparse or exact dot products.
dot.c— On 32-bit systems the accumulator can overflow when bothnlimbsandlenare large; detect and intercept this.dot.c— Verify carefully that the rounded partial sums cannot overflowthe guard bits in
re_sandim_s.dot.c— Use the truncating variant also when the term in question issmall.
mat_mul.c— The block-size condition innfloat_mat_mul_blockiswrong; work out the correct one.
mat_mul.c— Support fast matrix multiplication when inf/nan values ordirected rounding are in play.
nfixed.c— The Strassen error bound always includes the bordercorrection for odd dimensions; add it conditionally instead.
test/t-nfloat_directed.c— Make the directed rounding tests genericrather than
nfloat-specific.test/t-nfloat_directed.c— Extend the directed rounding tests to covervector operations.
nmod
nmod.h— Documentnmod_addmuland the relateda*b + c*dhelper.nmod.h— Decide whether the Montgomery context should cache theconstant 1; it would slow down context creation when unused.
gr_redc.c— Precomputeredc(R)and invert in Montgomery space, so oneconversion can be skipped.
gr_redc.c— Combine the_nmod_vec_dotand REDC techniques in thevector product.
nmod_mat
charpoly.c— Make the algorithm cutoff innmod_mat_charpolydepend onthe modulus.
lu_classical_delayed.c— Re-examine the delayed-reduction methodselection in light of the recent dot product changes.
mul_classical.c— Re-examine the dimension thresholds here after thevec_dotchanges.nmod_vec_mul.c— Try delaying the modular reductions in thematrix-vector product.
nmod_mpoly
div.c,divrem.c,divrem_ideal.c— These entry points fall back on apath flagged as unfinished; implement proper algorithms.
divides_heap_threaded.c,mpolyn_divides_threaded.c— The thread-safeappend relies on x86 store ordering; add explicit memory barriers for weakly
ordered architectures.
gcd_zippel.c— Instead of increasing the extension degree on everyfailure, try to find more irreducibles of the same degree first.
gcd_zippel.c,mpolyn_gcd_brown.c— The same prime-selection issuerecurs in the multivariate Zippel and Brown large-prime loops.
gcd_zippel2.c— Do not necessarily increase the degree at this point inthe large-prime GCD loop.
mpolyu.c— Determine whether these conversion functions are still used;remove them if not.
sort_terms.c— Radix sort recursion depth is proportional toN*FLINT_BITS; consider an iterative version.nmod_mpoly_factor
factor.c— Use Kaltofen's leading coefficient reconstruction(
lcc_kaltofen).n_bpoly_mod.c— Speed upn_bpoly_mod_mul_series.n_bpoly_mod_factor_smprime.c— Port this Zassenhaus lifting precisionstrategy to the other bivariate factorers.
nmod_poly
nmod_poly.h— Implement the commented-outmulmodpreconditionstrategies
NMOD_POLY_MULMOD_PRECOND_SPARSEand..._FFT.nmod_poly.h— Move these matrix-related declarations tonmod_mat.h.berlekamp_massey.c— Both reduction branches are always valid; find theright cutoff between them.
compose_mod_brent_kung_vec_preinv.c,compose_mod_brent_kung_vec_preinv_threaded.c— Precompute the powers ofhonce for repeated rectangular splitting instead of recomputing per call.divides.c,mullow_classical.c— Make the classical multiplicationcheck use
nmod_vec_dotmore directly.divrem_newton_n_preinv.c— Tune the sparse-divisor cutoff; it shoulddepend on both the operand lengths and the modulus.
divrem_newton_n_preinv.c— Optimize the sparse path for commoncoefficient combinations (1, -1, and others).
divrem_newton_n_preinv.c— Make the sparse division work in place.evaluate_geometric_nmod_vec.c— Optimize the middle product used here;it is often excellent but the
fft_smallvariant is still needed.gcdinv.c— Usenmod_poly_init_preinvhere to reuse the alreadycomputed inverse.
geometric_progression.c— If precomputation cost matters:extrapolatemay benefit from
n_mulmod_shoup, theinterpolatevariant is not fullyShoup-ified, and unrolling may help.
hgcd.c— The half-GCD implementation happens to support aliasing, butcallers should not rely on it; document or enforce.
minimal_irreducible.c— Refine and extend the table of minimalirreducible binomials.
mullow_fft_small.c— The norm bounds are pessimistic for veryunbalanced products; split the larger polynomial into chunks instead.
mullow_fft_small.c— Consider combining a 1-norm bound with an inf-normbound (Young's inequality): faster to evaluate than Cauchy–Schwarz, though
typically less tight.
mulmod_precond.c— Implement a genuine sparse method here rather thanrelying on
_nmod_poly_divrem_newton_n_preinv's sparse special case.mulmod_precond.c— Avoid zero-padding whenalen < n, and note thatthe quotient is only needed to precision
n - 1, so one fewer coefficient isrequired.
nmod_poly_factor
is_irreducible.c— Determine whether eliminating low-degree factorsbeyond linear ones is worthwhile in the trial division test.
is_irreducible.c— Use multipoint evaluation when the modulus is largeenough.
is_irreducible.c— Use a sparse algorithm when the polynomial issparse.
nmod_poly_mat
print.c— Add pretty-printing (named variable, aligned entries) tonmod_poly_mat_print.padic
exp_balanced.c— Take advantage of additional factors ofpin theargument
xin the balanced exponential.exp_rectangular.c— Improve the division by the factorial in therectangular splitting exponential.
log_satoh.c— Improve the heuristic that suggests the valuation used inSatoh's logarithm algorithm.
padic_mat
add.c—_padic_mat_addshould use the precision of the inputs ratherthan reducing at the output precision.
padic_poly
compose.c,compose_pow.c,evaluate_padic.c— This shared block ofp-adic arithmetic is duplicated in three files; move it into thepadicmodule.
inv_series.c— Explain why this particular Newton iteration gives theexpected result for non-normalized input (reducing coefficients mod
Nfirstmakes the tests fail, so
_fmpz_mod_poly_inv_seriescannot be used).shift_left.c,shift_right.c— Reduce the result after shifting ratherthan leaving it unreduced.
test/t-compose_pow.c— Confirm that initializing the test polynomialwith precision
WORD_MAXis valid.padic_radix
padic.c— Depending on operand sizes, the exactness test in divisionmay be cheaper as a Hensel division with remainder (
radix_divmod_bnwithnon-NULL
rem) than as a Euclidean division.padic.c— Optimizepadic_radix_inv.perm
perm.h—_perm_compose_inv1allocates a temporary bufferunconditionally; avoid it when the inputs do not alias.
qadic
qadic.h— These functions have names that do not use theqadicmoduleprefix; consider renaming them.
norm.c— Repeat the timing experiments that set the analytic-versus-resultant crossover for
p = 2, an important special case.norm_resultant.c— This branch is untested because the standardcontexts always use Conway polynomials; add coverage with a custom modulus.
sqrt.c— Find a better way to fold the squareness check into thecomputation of the square root itself.
test/t-sqrt.c— Unexplained marker on theqadic_randtest_valcall;clarify what needs checking about the chosen valuation range.
qqbar
cmp_re.c— Tune the algorithm cutoff based on the degrees and bit sizesof the operands.
cmp_re.c— Reuse the improved enclosures already computed during thecomparison.
cmp_re.c— Determine when it is better to compute and compare the realparts directly.
get_acb.c— Special-case quadratics, particularly Gaussian rationals,when converting to
acb.get_fexpr.c— Extend the fast root-of-unity detection to rationalmultiples of roots of unity.
get_fexpr.c— Consider allowing deflation to recurse in some cases,with appropriate safeguards.
get_fexpr.c— Consider always setting theGAUSSIANS/CYCLOTOMICSflags so roots of unity are expressed explicitly.
get_fexpr.c— Consider allowing separation to recurse, e.g. when thedegree has strictly decreased.
pow.c— Extend the fast path for roots of unity inqqbar_pow_uitorational multiples of roots of unity.
roots_poly_squarefree.c— Several improvements to root-finding forpolynomials with algebraic coefficients: support squareful polynomials
directly; use the quadratic formula for quadratics; compute tighter
denominator bounds or rescale for smaller coefficients; exploit coefficients
lying in a small common number field to reduce the degree; determine whether
exact verification ever beats numerics; and guess low-degree roots with LLL
to remove them before the full computation.
roots_poly_squarefree.c— Copy the original enclosures and reuse themfor refinement instead of recomputing.
write.c— Document, unify and generalize theqqbarprinting code; itis currently shaped only for the Python interface, but other wrappers need it
too.
radix
div.c— Zeroing the low limbs of the quotient can be optimized away.div.c— Choose the initial approximationTso thatT*A' <= 1alwaysholds, removing the need for the sign check.
div.c— Use the unbalanced division algorithm fromradix_divreminradix_divrem_preinvtoo.init_clear.c— Optimize the division in_radix_val_pow2.integer.c— Optimizeradix_integer_cdiv_qr.invmod_bn.c— Consider storing a dynamic table in the radix contextobject rather than recomputing it.
invmod_bn.c— Tighten the allocation for the case where a mulhigh isalways used.
rsqrtmod_bn.c—_radix2_rsqrtmod_bnmay use one extra limbinternally; confirm the caller's buffer accounts for it.
sqrt.c— Reduce the temporary space used byradix_rsqrt_1_approx.thread_pool
find_work.c— The work-stealing counter can overflow in extreme cases(low priority).
ulong_extras
CRT.c— Improve the implementation ofn_CRT.factorial_mod2_preinv.c— Add a faster path fornaroundsqrt(UWORD_MAX).ll_is_prime.c— Determine whether the2^192 / mprecomputation canbeat
mpn_tdiv_qr.ll_is_prime.c— Try to prove that the conditional correction inn_ll_small_reduce2_preciseis needed at most once.ll_is_prime.c— The first two powmod rounds skip reduction whenb^7fits in a limb; one more round may be possible with a two-word result.
ll_is_prime.c— Implement a reasonable 64-bit primality test for thedouble-limb powmod path rather than deferring to the general code.
ll_is_prime.c—n_ll_lemocks up double-limb comparison; replace itonce a proper double-limb type is available.
test/t-factor_lehman.c— This case was added as a regression test foran unidentified bug; document which bug it covers.
Build system and CI
Makefile.in— Detect the number of available cores via autoconf(equivalent of
nproc) instead of defaulting toNJOBS := 8when-jisgiven without a number.
Makefile.in— Remove the hardcodedfq_zech_vecspecial case from thetest source discovery.
configure.ac— Extend the processor detection check to cover more CPUmodels.
.github/workflows/release.yml— Add amake installsmoke test to therelease workflow.
.github/codecov.yml— Raise the coverage target range from 70–95 toroughly 90–95.
Documentation
doc/source/ca.rst— Document (and implement) coercion of acaelementto a low-degree cyclotomic field where possible, alongside the existing
quadratic case.
doc/source/gr_generic.rst— Move the generic special functiondocumentation (Bernoulli, Euler, Stirling) to the
gr_specialsection.doc/source/gr_generic.rst— Move the generic vector methoddocumentation to the
gr_vecsection.Examples
examples/mfcoefs.c— Handle the space character when parsing thecharacter/form specification.
examples/mfcoefs.c— This step may be skippable depending on the form;determine when.
examples/mfcoefs.c— Only prime indices are needed in this loop;restrict it accordingly.
Python interface
src/python/flint_ctypes.py— Unexplained marker in_gr_set_intwherexvecandyvecare aliased to the same vector; verify this is intentional.src/python/flint_ctypes.py—gr_seriescoefficient access goesthrough
gr_poly_get_coeff_scalar; add a propergr_seriesmethod.src/python/mpmath2.py—RFContext.argshould use themath2implementation.