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
#include <flint/dfloat.h>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).
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).
@misc{flint-doc-dfloat-d1-tan,
author = {{The FLINT team}},
title = {{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)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/dfloat/d1_tan.html},
note = {Generated 2026-10-20}
}