d1_canonicalise, d2_canonicalise, d3_canonicalise, d4_canonicalise, d1b_canonicalise, d2b_canonicalise, d3b_canonicalise, d4b_canonicalise
#include <flint/dfloat.h>void d1b_canonicalise(d1b_t res, d1b_srcptr x)void d2b_canonicalise(d2b_t res, d2b_srcptr x)void d3b_canonicalise(d3b_t res, d3b_srcptr x)void d4b_canonicalise(d4b_t res, d4b_srcptr x)Sets res to x (exactly, with the radius unchanged) with the components in canonical form: |x_{i+1}| \le \operatorname{ulp}(x_i)/2 and zeros only at the end, which is the form obtained by rounding the value to nearest term by term. Works for any x whose components overlap by at most a few bits, in particular any result of this module. A nonfinite head is copied as it is by dN_canonicalise; dNb_canonicalise gives the whole real line in its normal form.
The arithmetic renormalises with a single bottom-up pass (weak renormalisation), which is all the error analysis needs, but after a cancellation a component can be smaller than the one following it, so the representation is not unique and dN_equal compares values rather than components. For N = 2 the weak form is already canonical; for N = 3, 4 about 4 to 7% of the results of random operations are not. Canonicalisation is a top-down TwoSum chain with a check, and a branchy repair pass in about 10^{-5} to 10^{-4} of the cases.
The FLINT team, “d1_canonicalise, d2_canonicalise, d3_canonicalise, d4_canonicalise, d1b_canonicalise, d2b_canonicalise, d3b_canonicalise, d4b_canonicalise (dfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dfloat/d1_canonicalise.html (generated 2026-10-20).
@misc{flint-doc-dfloat-d1-canonicalise,
author = {{The FLINT team}},
title = {{d1\_canonicalise, d2\_canonicalise, d3\_canonicalise, d4\_canonicalise, d1b\_canonicalise, d2b\_canonicalise, d3b\_canonicalise, d4b\_canonicalise (dfloat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/dfloat/d1_canonicalise.html},
note = {Generated 2026-10-20}
}