FLINT3.7.0-dev

_mp_real_pow_fp

Synopsis#include <flint/mp_real.h>
int _mp_real_pow_fp(nn_ptr y, ulong * err, nn_ptr q, slong * qn, int * tsgn, nn_srcptr xd, slong xn, slong xe, nn_srcptr yd, slong yn, slong ye, int ysgn, slong pb, slong tbmax)source

∣x∣y=et|x|^y = e^t, t=ylog⁡∣x∣t = y \log |x|, for the mantissas x=(xd,xn) 2xe−xn FLINT_BITSx = (xd, xn) \, 2^{xe - xn \, \mathtt{FLINT\_BITS}} (∣xe∣<2FLINT_BITS−3|xe| < 2^{\mathtt{FLINT\_BITS} - 3}) and y=(−1)ysgn(yd,yn) 2ye−yn FLINT_BITSy = (-1)^{\mathit{ysgn}} (yd, yn) \, 2^{ye - yn \, \mathtt{FLINT\_BITS}}: sets Y=(y,nk+1)Y = (y, \mathit{nk} + 1) (y needs nk + 2 limbs) and err such that ∣x∣y=Y 2K−FLINT_BITS nk|x|^y = Y \, 2^{K - \mathtt{FLINT\_BITS} \, \mathit{nk}} within err units, with the exponent K=(−1)returned sign(q,qn)K = (-1)^{\text{returned sign}} (q, \mathit{qn}), q needing ⌈tbmax/FLINT_BITS⌉+2\lceil \mathit{tbmax} / \mathtt{FLINT\_BITS} \rceil + 2 limbs (qn = 0 for K=0K = 0). Instead of the sign it returns MP_REAL_POW_ONE for ∣x∣=1|x| = 1, MP_REAL_POW_TINY when ∣t∣<2−(FLINT_BITS nk+4)|t| < 2^{-(\mathtt{FLINT\_BITS} \, \mathit{nk} + 4)}, so that ∣x∣y=1+δ|x|^y = 1 + \delta with 0<∣δ∣<2−(FLINT_BITS nk+3)0 < |\delta| < 2^{-(\mathtt{FLINT\_BITS} \, \mathit{nk} + 3)} and δ\delta of the sign tsgn (1 for negative), or MP_REAL_POW_HUGE when ∣t∣≥2tbmax|t| \ge 2^{\mathit{tbmax}} (tbmax ≥FLINT_BITS−3\ge \mathtt{FLINT\_BITS} - 3), with the sign of tt in tsgn. The logarithm runs at nk+⌈(tb+12)/FLINT_BITS⌉\mathit{nk} + \lceil (\mathit{tb} + 12) / \mathtt{FLINT\_BITS} \rceil limbs for the bound 2tb2^{\mathit{tb}} on ∣t∣|t|; err is that of the exponential plus a few units.

Cite this page

The FLINT team, “_mp_real_pow_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_pow_fp.html (generated 2026-11-17).