FLINT3.7.0-dev

d1_tan, d2_tan, d3_tan, d4_tan, d1_sinh, d2_sinh, d3_sinh, d4_sinh, d1_cosh, d2_cosh, d3_cosh, d4_cosh, d1_tanh, d2_tanh, d3_tanh, d4_tanh, d1_asin, d2_asin, d3_asin, d4_asin, d1_acos, d2_acos, d3_acos, d4_acos, d1_atan2, d2_atan2, d3_atan2, d4_atan2, d1_pow, d2_pow, d3_pow, d4_pow

Synopsis#include <flint/dfloat.h>
void d1_tan(d1_t res, d1_srcptr x)
void d2_tan(d2_t res, d2_srcptr x)
void d3_tan(d3_t res, d3_srcptr x)
void d4_tan(d4_t res, d4_srcptr x)
void d1_sinh(d1_t res, d1_srcptr x)
void d2_sinh(d2_t res, d2_srcptr x)
void d3_sinh(d3_t res, d3_srcptr x)
void d4_sinh(d4_t res, d4_srcptr x)
void d1_cosh(d1_t res, d1_srcptr x)
void d2_cosh(d2_t res, d2_srcptr x)
void d3_cosh(d3_t res, d3_srcptr x)
void d4_cosh(d4_t res, d4_srcptr x)
void d1_tanh(d1_t res, d1_srcptr x)
void d2_tanh(d2_t res, d2_srcptr x)
void d3_tanh(d3_t res, d3_srcptr x)
void d4_tanh(d4_t res, d4_srcptr x)
void d1_asin(d1_t res, d1_srcptr x)
void d2_asin(d2_t res, d2_srcptr x)
void d3_asin(d3_t res, d3_srcptr x)
void d4_asin(d4_t res, d4_srcptr x)
void d1_acos(d1_t res, d1_srcptr x)
void d2_acos(d2_t res, d2_srcptr x)
void d3_acos(d3_t res, d3_srcptr x)
void d4_acos(d4_t res, d4_srcptr x)
void d1_atan2(d1_t res, d1_srcptr y, d1_srcptr x)
void d2_atan2(d2_t res, d2_srcptr y, d2_srcptr x)
void d3_atan2(d3_t res, d3_srcptr y, d3_srcptr x)
void d4_atan2(d4_t res, d4_srcptr y, d4_srcptr x)
void d1_pow(d1_t res, d1_srcptr x, d1_srcptr y)
void d2_pow(d2_t res, d2_srcptr x, d2_srcptr y)
void d3_pow(d3_t res, d3_srcptr x, d3_srcptr y)
void d4_pow(d4_t res, d4_srcptr x, d4_srcptr y)

Further elementary functions, as compositions of the kernels with the arithmetic (the arguments are canonicalised first). Their relative errors are about the sums of those of their parts (about 2^{-49}, 2^{-98}, 2^{-149}, 2^{-199}), except that dN_pow amplifies the error of the logarithm by |y \log x| (up to 2^{9.5} at the end of the range of the exponential) and that tan, sinh and tanh inherit absolute errors near their zeros. dN_atan2(res, y, x) follows the double atan2 for nonfinite arguments, and dN_pow gives NaN for x < 0 and noninteger y.

The formulas are \tan x = \sin x / \cos x; \sinh |x| = e(e + 2)/(2(e + 1)) with e = \operatorname{expm1}|x| for |x| < 1 and (E - 1/E)/2 with E = e^{|x|} beyond; \cosh x = (E + 1/E)/2; \tanh |x| = e/(e + 2) with e = \operatorname{expm1}(2|x|) for |x| < 1 and 1 - 2/(E + 1) with E = e^{2|x|} beyond; \operatorname{asin} x = \operatorname{atan}(x/\sqrt{(1 - x)(1 + x)}) and \operatorname{acos} x = 2 \operatorname{atan}\sqrt{(1 - x)/(1 + x)} (where 1 \pm x cancel they are exact, so both stay relative up to \pm 1); \operatorname{atan2}(y, x) = \operatorname{atan}(y/x) adjusted by \pm\pi for x < 0 and \pm\pi/2 for x = 0; and x^y = \exp(y \log x) for x > 0, binary powering of x or 1/x for an integer y with |y| < 2^{40} (any base).

Cite this page

The FLINT team, “d1_tan, d2_tan, d3_tan, d4_tan, d1_sinh, d2_sinh, d3_sinh, d4_sinh, d1_cosh, d2_cosh, d3_cosh, d4_cosh, d1_tanh, d2_tanh, d3_tanh, d4_tanh, d1_asin, d2_asin, d3_asin, d4_asin, d1_acos, d2_acos, d3_acos, d4_acos, d1_atan2, d2_atan2, d3_atan2, d4_atan2, d1_pow, d2_pow, d3_pow, d4_pow (dfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dfloat/d1_tan.html (generated 2026-10-20).