FLINT3.7.0-dev

nfloat_sin, nfloat_cos, nfloat_sin_cos, nfloat_tan, nfloat_sin_pi, nfloat_cos_pi, nfloat_sin_cos_pi, nfloat_tan_pi

Synopsis#include <flint/nfloat.h>
int nfloat_sin(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_cos(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sin_cos(nfloat_ptr res1, nfloat_ptr res2, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_tan(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sin_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_cos_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sin_cos_pi(nfloat_ptr res1, nfloat_ptr res2, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_tan_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source

Sine, cosine and tangent of x and of \pi x; the sin_cos versions compute both. The argument is reduced modulo \pi/2 in fixed point, repeated with more bits when the reduced argument is close to a zero of the result, so that the results have relative accuracy; the functions of \pi x reduce x modulo 2 exactly.

Guides#

Cite this page

The FLINT team, “nfloat_sin, nfloat_cos, nfloat_sin_cos, nfloat_tan, nfloat_sin_pi, nfloat_cos_pi, nfloat_sin_cos_pi, nfloat_tan_pi (nfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nfloat/nfloat_sin.html (generated 2026-10-20).