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)\exp(x), respectively sin⁡x\sin x and cos⁡x\cos x, for any (x,n)(x, n) in [0,1)[0, 1) without precomputed tables: the argument is halved down to the depth rr, 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+1n + 1 limbs; err is at most 128. The _r versions take the depth rr explicitly, for tuning.

With zz the leading zero bits of xx, the argument is halved h=max⁡(0,r−z)h = \max(0, r - z) times. The exponential is squared hh times (one sqrhigh each, all values in [1,e)[1, e)); relative errors double per squaring, which h+log⁡2n+8h + \log_2 n + 8 guard bits absorb. The angle is doubled on g=1−cos⁡g = 1 - \cos alone, g(2θ)=2g(2−g)g(2\theta) = 2g(2 - g), and the sine recovered at the end as 2g−g2\sqrt{2g - g^2}; 2h+z+log⁡2n+82h + 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-11-02).