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)sourceint nfloat_cos(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)sourceint nfloat_sin_cos(nfloat_ptr res1, nfloat_ptr res2, nfloat_srcptr x, gr_ctx_t ctx)sourceint nfloat_tan(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)sourceint nfloat_sin_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)sourceint nfloat_cos_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)sourceint nfloat_sin_cos_pi(nfloat_ptr res1, nfloat_ptr res2, nfloat_srcptr x, gr_ctx_t ctx)sourceint nfloat_tan_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)sourceSine, 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).
@misc{flint-doc-nfloat-nfloat-sin,
author = {{The FLINT team}},
title = {{nfloat\_sin, nfloat\_cos, nfloat\_sin\_cos, nfloat\_tan, nfloat\_sin\_pi, nfloat\_cos\_pi, nfloat\_sin\_cos\_pi, nfloat\_tan\_pi (nfloat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nfloat/nfloat_sin.html},
note = {Generated 2026-10-20}
}