_mp_real_sin_cos_fp, _mp_real_tan_fp, _mp_real_sin_cos_pi_fp, _mp_real_tan_pi_fp
#include <flint/mp_real.h>int _mp_real_sin_cos_fp(nn_ptr ys, nn_ptr yc, slong * w, ulong * err, nn_srcptr d, slong n, slong e, slong pb, slong wmax, int rel)sourceint _mp_real_tan_fp(nn_ptr y, slong * w, ulong * err, int * recip, nn_srcptr d, slong n, slong e, slong pb, slong wmax)sourceint _mp_real_sin_cos_pi_fp(nn_ptr ys, nn_ptr yc, slong * w, slong * k, ulong * err, nn_srcptr d, slong n, slong e, slong pb, slong wmax, int rel)sourceint _mp_real_tan_pi_fp(nn_ptr y, slong * w, slong * k, ulong * err, int * recip, nn_srcptr d, slong n, slong e, slong pb, slong wmax)sourceThe trigonometric functions of the magnitude , , or of (the pi versions); the caller applies the sign of to the odd functions. The outputs are fixed-point values at fraction limbs within err units, with : the kernels add limbs beyond nk for the relative accuracy of a sine or tangent near its zeros as far as wmax allows ( _mp_real_elem_limbs(pb + z) for leading zero bits); for the sine and cosine, rel says which outputs need that relative accuracy (bit 0 the sine, bit 1 the cosine), so that an output wanted only for a bound costs no extra limbs. Buffers need wmax + 2 limbs (the sine and tangent of the pi versions max(n, nk) + 3 as well). The return value carries the signs (bit 0: the sine or tangent is negative, bit 1: the cosine is negative), or MP_REAL_TRIG_EXACT with the quadrant in bits 0–1 when the values are exact (0, 1 / 1, 0 / 0, / , 0; the tangent 0 or a pole, or with MP_REAL_TRIG_ONE), or MP_REAL_TRIG_TINY for a tiny of the pi versions, where the sine or tangent is returned as a product with a radix-2 exponent k and err = 6, within one-sided bounds. For the tangent, recip = 1 means that the value is rather than ; the kernel chooses the limbs so that normalises with a left shift of at most MP_REAL_TRIG_FP_NORM_SHIFT bits.
In the pi versions, a reduced argument with a denominator of at most bits is evaluated by _mp_real_sin_cos_pi_ui_div_ui resp. _mp_real_tan_pi_ui_div_ui instead of the kernel on wherever their algebraic methods win (_mp_real_sin_cos_pi_ui_div_ui_algebraic): by one square root, by half angles from about 24 limbs, and so on.
The FLINT team, “_mp_real_sin_cos_fp, _mp_real_tan_fp, _mp_real_sin_cos_pi_fp, _mp_real_tan_pi_fp (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/_mp_real_sin_cos_fp.html (generated 2026-11-17).
@misc{flint-doc-mp-real-mp-real-sin-cos-fp,
author = {{The FLINT team}},
title = {{\_mp\_real\_sin\_cos\_fp, \_mp\_real\_tan\_fp, \_mp\_real\_sin\_cos\_pi\_fp, \_mp\_real\_tan\_pi\_fp (mp\_real.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mp_real/_mp_real_sin_cos_fp.html},
note = {Generated 2026-11-17}
}