FLINT3.7.0-dev

arf_complex_mul, arf_complex_mul_fallback

Synopsis#include <flint/arf.h>
int arf_complex_mul(arf_t e, arf_t f, const arf_t a, const arf_t b, const arf_t c, const arf_t d, slong prec, arf_rnd_t rnd)source
int arf_complex_mul_fallback(arf_t e, arf_t f, const arf_t a, const arf_t b, const arf_t c, const arf_t d, slong prec, arf_rnd_t rnd)source

Set e+fi=(a+bi)(c+di)e + fi = (a + bi)(c + di) with both parts correctly rounded. Bit 0 of the return value is the inexact flag of ee and bit 1 that of ff.

If one of a,b,c,da, b, c, d is zero, the product is computed with two real multiplications and no additions, even if another component is infinite or NaN; special values follow from this rule. From 13 limbs of precision (up to 2000 limbs), for balanced parts of comparable magnitude, the complex high product (flint_mpn_mulhigh_n_complex) gives both parts within a few units of a guard limb, and the rounding is certified as in arf_mul. Otherwise arf_complex_mul forms the exact products and rounds ac−bdac - bd and ad+bcad + bc once each: when all four mantissas have at least 20 limbs and the exponents of the real and imaginary parts are within 64 bits of each other, with the exact complex product flint_mpn_mul_complex (Karatsuba's three products, or shared fft_small transforms), else with four real products. arf_complex_mul_fallback is the plain version with four products, kept for testing.

Cite this page

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