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) with both parts correctly rounded. Bit 0 of the return value is the inexact flag of e and bit 1 that of f.

If one of a, 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. arf_complex_mul forms the exact products of the mantissas and rounds ac - bd and ad + 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, it uses Karatsuba's three-product formula ad + bc = (a+b)(c+d) - ac - bd. 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-10-20).