d1_add, d2_add, d3_add, d4_add, d1_sub, d2_sub, d3_sub, d4_sub, d1_mul, d2_mul, d3_mul, d4_mul, d1_sqr, d2_sqr, d3_sqr, d4_sqr, d1_mul_d, d2_mul_d, d3_mul_d, d4_mul_d, d1_div, d2_div, d3_div, d4_div, d1_inv, d2_inv, d3_inv, d4_inv, d1_sqrt, d2_sqrt, d3_sqrt, d4_sqrt, d1_rsqrt, d2_rsqrt, d3_rsqrt, d4_rsqrt, d1_mul_2exp_si, d2_mul_2exp_si, d3_mul_2exp_si, d4_mul_2exp_si
#include <flint/dfloat.h>Arithmetic on the plain formats, accurate to a few ulps at 53N bits: sum, difference, product, square, product with a double, quotient, inverse, square root, reciprocal square root x^{-1/2} and multiplication by 2^e. Overflow gives infinity, and nonfinite values propagate as in double arithmetic.
Addition, subtraction and multiplication compute the exact terms of each order with error-free transformations and renormalise; terms of order N and beyond are dropped in multiplication. Division is a long division whose digits are single double divisions, and the square roots are Newton iterations with tapered precision; dN_rsqrt doubles the number of correct components per step and is accurate to about 8 u^N, u = 2^{-53}. See Double-word and multi-double arithmetic.
The results are compact weakly normalised expansions: a component that comes out exactly zero after a cancellation is squeezed out, so that the magnitudes of the components always decrease geometrically. The tapered kernels (division, square roots and the elementary functions) rely on this and lose accuracy on an expansion with an internal zero such as (2^{-86}, 0, 2^{-140}, 0), which the module never produces; an expansion built by hand in this form should be passed through dN_canonicalise first (the elementary functions do this themselves, but dN_div, dN_sqrt and dN_rsqrt do not).
Guides#
The FLINT team, “d1_add, d2_add, d3_add, d4_add, d1_sub, d2_sub, d3_sub, d4_sub, d1_mul, d2_mul, d3_mul, d4_mul, d1_sqr, d2_sqr, d3_sqr, d4_sqr, d1_mul_d, d2_mul_d, d3_mul_d, d4_mul_d, d1_div, d2_div, d3_div, d4_div, d1_inv, d2_inv, d3_inv, d4_inv, d1_sqrt, d2_sqrt, d3_sqrt, d4_sqrt, d1_rsqrt, d2_rsqrt, d3_rsqrt, d4_rsqrt, d1_mul_2exp_si, d2_mul_2exp_si, d3_mul_2exp_si, d4_mul_2exp_si (dfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dfloat/d1_add.html (generated 2026-10-20).
@misc{flint-doc-dfloat-d1-add,
author = {{The FLINT team}},
title = {{d1\_add, d2\_add, d3\_add, d4\_add, d1\_sub, d2\_sub, d3\_sub, d4\_sub, d1\_mul, d2\_mul, d3\_mul, d4\_mul, d1\_sqr, d2\_sqr, d3\_sqr, d4\_sqr, d1\_mul\_d, d2\_mul\_d, d3\_mul\_d, d4\_mul\_d, d1\_div, d2\_div, d3\_div, d4\_div, d1\_inv, d2\_inv, d3\_inv, d4\_inv, d1\_sqrt, d2\_sqrt, d3\_sqrt, d4\_sqrt, d1\_rsqrt, d2\_rsqrt, d3\_rsqrt, d4\_rsqrt, d1\_mul\_2exp\_si, d2\_mul\_2exp\_si, d3\_mul\_2exp\_si, d4\_mul\_2exp\_si (dfloat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/dfloat/d1_add.html},
note = {Generated 2026-10-20}
}