FLINT3.7.0-dev

_mp_real_sinh_cosh_fp, _mp_real_tanh_fp

Synopsis#include <flint/mp_real.h>
slong _mp_real_sinh_cosh_fp(nn_ptr ys, nn_ptr yc, slong * w, ulong * err, nn_srcptr d, slong n, slong e, slong pb)source
void _mp_real_tanh_fp(nn_ptr q, slong * w, ulong * err, nn_srcptr d, slong n, slong e, slong pb)source

The hyperbolic functions of ∣x∣=(d,n) 2e−n FLINT_BITS|x| = (d, n) \, 2^{e - n \, \mathtt{FLINT\_BITS}}, e≤e \le MP_REAL_EXP_FP_MAX_EXP, not tiny: from E=e∣x∣E = e^{|x|} and one approximate reciprocal, at w=nkw = \mathit{nk} limbs for ∣x∣≥1|x| \ge 1 and w=w = _mp_real_elem_limbs(pb + 1 - e) for ∣x∣<1|x| < 1 (the cancellation in E−1/EE - 1/E). _mp_real_sinh_cosh_fp sets Ys=(ys,w+1)Y_s = (ys, w + 1) and Yc=(yc,w+1)Y_c = (yc, w + 1) (either NULL; w + 2 limbs each) with sinh⁡∣x∣=Ys 2k−FLINT_BITS w\sinh |x| = Y_s \, 2^{k - \mathtt{FLINT\_BITS} \, w} and cosh⁡x=Yc 2k−FLINT_BITS w\cosh x = Y_c \, 2^{k - \mathtt{FLINT\_BITS} \, w} within err units, returning kk (−1-1 for ∣x∣<1|x| < 1); _mp_real_tanh_fp sets tanh⁡∣x∣=(q,w+1) B−w\tanh |x| = (q, w + 1) \, B^{-w} within err units (q needs w + 2 limbs). err is at most twice that of the exponential plus a few units; for ∣x∣|x| so large that 2e−2∣x∣2 e^{-2|x|} is below a unit, the result is 11 within a unit without any evaluation.

Cite this page

The FLINT team, “_mp_real_sinh_cosh_fp, _mp_real_tanh_fp (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/_mp_real_sinh_cosh_fp.html (generated 2026-11-17).