FLINT3.7.0-dev

nfloat_exp10, nfloat_log10, nfloat_cot, nfloat_sec, nfloat_csc, nfloat_sinc, nfloat_cot_pi, nfloat_sec_pi, nfloat_csc_pi, nfloat_sinc_pi, nfloat_coth, nfloat_sech, nfloat_csch, nfloat_asin, nfloat_acos, nfloat_asin_pi, nfloat_acos_pi, nfloat_atan_pi, nfloat_acot, nfloat_asec, nfloat_acsc, nfloat_acot_pi, nfloat_asec_pi, nfloat_acsc_pi, nfloat_asinh, nfloat_acosh, nfloat_atanh, nfloat_acoth, nfloat_asech, nfloat_acsch

Synopsis#include <flint/nfloat.h>
int nfloat_exp10(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_log10(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_cot(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sec(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_csc(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sinc(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_cot_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sec_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_csc_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sinc_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_coth(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_sech(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_csch(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_asin(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acos(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_asin_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acos_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_atan_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acot(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_asec(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acsc(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acot_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_asec_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acsc_pi(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_asinh(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acosh(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_atanh(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acoth(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_asech(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source
int nfloat_acsch(nfloat_ptr res, nfloat_srcptr x, gr_ctx_t ctx)source

The less common elementary functions. After the exact special values (zeros, poles, |x| = 1 for the inverse functions, multiples of 1/2 for the functions of \pi x), they are evaluated as short compositions of the functions above in an internal context with a guard word (none when the function precision is sufficiently below the precision), using formulas without cancellation, such as \operatorname{asin}(x) = \operatorname{atan2}(x, \sqrt{(1 - x)(1 + x)}) and \operatorname{asinh}(x) = \operatorname{log1p}(|x| + x^2/(1 + \sqrt{1 + x^2})), and a rigorous bound for the composed error, which is added to obtain valid bounds with directed rounding.

On 64-bit machines, at one and two words, the reciprocal functions (sec, csc, sech, csch, also of \pi x) and sinc (also of \pi x) instead divide the fixed-point outputs of the in-register fast paths of the sine, the cosine and the paired exponentials, and the inverse functions are evaluated in fixed point at one more word: y^2 \pm 1 exactly, square roots by a refined reciprocal square root (as for nfloat_sqrt at two words), the arctangent of a ratio (asin, acos, asec, acsc, acot and the functions divided by \pi, which multiply by 2/\pi) or the logarithm kernels (the inverse hyperbolic functions, as sums of logarithms of the same sign, for example \operatorname{atanh}(y) = (\operatorname{log1p}(y) - \log(1 - y))/2). Arguments where an intermediate result would lose relative accuracy at that precision (results below about 2^{-32} or 2^{-40} from small differences, |x| \ge 2^{62}) take the general path.

Cite this page

The FLINT team, “nfloat_exp10, nfloat_log10, nfloat_cot, nfloat_sec, nfloat_csc, nfloat_sinc, nfloat_cot_pi, nfloat_sec_pi, nfloat_csc_pi, nfloat_sinc_pi, nfloat_coth, nfloat_sech, nfloat_csch, nfloat_asin, nfloat_acos, nfloat_asin_pi, nfloat_acos_pi, nfloat_atan_pi, nfloat_acot, nfloat_asec, nfloat_acsc, nfloat_acot_pi, nfloat_asec_pi, nfloat_acsc_pi, nfloat_asinh, nfloat_acosh, nfloat_atanh, nfloat_acoth, nfloat_asech, nfloat_acsch (nfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nfloat/nfloat_exp10.html (generated 2026-10-20).