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

All work happens at the output precision, which is why the bound grows with rr; a caller wanting sub-ulp accuracy pads the precision itself. With r=0r = 0, sizes n≤10n \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 2562^{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-11-02).