FLINT3.7.0-dev

_mp_real_exp_notab, _mp_real_exp_notab_r, _mp_real_sin_cos_notab, _mp_real_sin_cos_notab_r

Synopsis#include <flint/mp_real.h>
void _mp_real_exp_notab(nn_ptr y, ulong * err, nn_srcptr x, slong n)source
void _mp_real_exp_notab_r(nn_ptr y, ulong * err, nn_srcptr x, slong n, int r)source
void _mp_real_sin_cos_notab(nn_ptr ysin, nn_ptr ycos, ulong * err, nn_srcptr x, slong n)source
void _mp_real_sin_cos_notab_r(nn_ptr ysin, nn_ptr ycos, ulong * err, nn_srcptr x, slong n, int r)source

Evaluate \exp(x), respectively \sin x and \cos x, for any (x, n) in [0, 1) without precomputed tables: the argument is halved down to the depth r, the reduced function evaluated by _mp_real_exp_reduced resp. _mp_real_sin_cos_reduced, and the result squared resp. the angle doubled back. Outputs have n + 1 limbs; err is at most 128. The _r versions take the depth r explicitly, for tuning.

With z the leading zero bits of x, the argument is halved h = \max(0, r - z) times. The exponential is squared h times (one sqrhigh each, all values in [1, e)); relative errors double per squaring, which h + \log_2 n + 8 guard bits absorb. The angle is doubled on g = 1 - \cos alone, g(2\theta) = 2g(2 - g), and the sine recovered at the end as \sqrt{2g - g^2}; 2h + z + \log_2 n + 8 guard bits absorb the amplification. The tuned depth is 16 or 32 for the exponential and 24 or 32 for the sine and cosine.

Guides#

Cite this page

The FLINT team, “_mp_real_exp_notab, _mp_real_exp_notab_r, _mp_real_sin_cos_notab, _mp_real_sin_cos_notab_r (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_notab.html (generated 2026-10-20).