FLINT3.7.0-dev

_mp_real_exp_bitwise_rs, _mp_real_log1p_bitwise_rs, _mp_real_sin_cos_bitwise_rs, _mp_real_tan_bitwise_rs, _mp_real_atan_bitwise_rs

Synopsis#include <flint/mp_real.h>
void _mp_real_exp_bitwise_rs(nn_ptr res, ulong * err, nn_srcptr x, slong n, int r)source
void _mp_real_log1p_bitwise_rs(nn_ptr res, ulong * err, nn_srcptr x, slong n, int r)source
void _mp_real_sin_cos_bitwise_rs(nn_ptr ysin, nn_ptr ycos, ulong * err, nn_srcptr x, slong n, int r)source
void _mp_real_tan_bitwise_rs(nn_ptr res, ulong * err, nn_srcptr x, slong n, int r)source
void _mp_real_atan_bitwise_rs(nn_ptr res, ulong * err, nn_srcptr x, slong n, int r)source

Evaluate \exp(x), \log(1 + x), \sin x and \cos x, \tan x resp. \operatorname{atan} x for any x \in [0, 1) by bitwise (BKM-type) argument reduction below 2^{-r} with cached tables of \log(1 + 2^{-i}) resp. \operatorname{atan}(2^{-i}), followed by a series and a reconstruction. The outputs have n + 1 limbs for exp, sin, cos and tan (either of ysin, ycos may be NULL) and n limbs for log1p and atan. err is at most 9r + 100 (exp), 3r + 64 (log1p), 6r + 128 (sin and cos), 8r + 256 (tan) resp. 4r + 64 (atan), for the r used. r = 0 selects the tuned default, at most 768; explicit values require r \ge 32. On 32-bit machines n \ge 2 is required.

All work happens at the output precision, which is why the bound grows with r; a caller wanting sub-ulp accuracy pads the precision itself. With r = 0, sizes n \le 10 on 64-bit machines go to the per-size kernels (table-driven at one to three limbs, dense-table at four to ten limbs), and from a few limbs the reduction runs with signed digits on vector lanes in radix 2^{56} (_mp_real_exp_bitwise_vec and its siblings, listed under Internal functions). The tables are process-wide caches built on first use at the largest precision and index range requested so far. See Bitwise reduction.

Guides#

Cite this page

The FLINT team, “_mp_real_exp_bitwise_rs, _mp_real_log1p_bitwise_rs, _mp_real_sin_cos_bitwise_rs, _mp_real_tan_bitwise_rs, _mp_real_atan_bitwise_rs (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_bitwise_rs.html (generated 2026-10-20).