FLINT3.7.0-dev

_mp_real_exp_reduced, _mp_real_sin_cos_reduced

Synopsis#include <flint/mp_real.h>
void _mp_real_exp_reduced(nn_ptr y, ulong * err, nn_srcptr t, slong n, flint_bitcnt_t r, int alg)source
void _mp_real_sin_cos_reduced(nn_ptr ysin, nn_ptr yg, ulong * err, nn_srcptr t, slong n, flint_bitcnt_t r, int alg)source

Evaluate \exp(t), respectively \sin t and g = 1 - \cos t, for a reduced argument (t, n) with t < 2^{-r}, r \ge 16 (r \ge 32 for alg = 1, 2). The exponential is written to n + 1 limbs; the sine and g are pure fractions written to n limbs, but both buffers need room for n + 1 limbs. err is the rigorous bound computed at run time, at most 96.

alg selects the method: 0 the tuned choice; 1 the rectangular splitting series (_mp_real_exp_rs, _mp_real_sin_cos_rs); 2 the \sinh series and a square root, resp. the sine series and g = 1 - \sqrt{1 - \sin^2 t} (half the terms); 3 one bit-burst step, the leading slice of t by binary splitting and the rest by the series; 4 the full bit-burst algorithm, asymptotically quasi-optimal. The cosine is returned as g, which keeps the information near the top for the half-angle reconstructions that consume it. Except for the direct series, the arithmetic around the series and the binary splitting is mp_real_t ball arithmetic, so that the bound comes out rigorous. The binary splittings share the transforms of their power tables across the merges (see Power tables with precomputed transforms).

Guides#

Cite this page

The FLINT team, “_mp_real_exp_reduced, _mp_real_sin_cos_reduced (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/_mp_real_exp_reduced.html (generated 2026-10-20).