{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;x \leq 6834308.8393940255:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{\mathsf{log1p}\left(x\right)}{n}\\
\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{n \cdot n}, \mathsf{fma}\left(0.16666666666666666, {t_1}^{3}, t_1\right)\right) - \mathsf{fma}\left(0.16666666666666666, {t_0}^{3}, \mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n \cdot n}, t_0\right)\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{t_0}}{x \cdot n}\\
\end{array}
(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) n)))
(if (<= x 6834308.8393940255)
(let* ((t_1 (/ (log1p x) n)))
(-
(fma
0.5
(/ (pow (log1p x) 2.0) (* n n))
(fma 0.16666666666666666 (pow t_1 3.0) t_1))
(fma
0.16666666666666666
(pow t_0 3.0)
(fma 0.5 (/ (pow (log x) 2.0) (* n n)) t_0))))
(/ (exp t_0) (* x n)))))double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
double code(double x, double n) {
double t_0 = log(x) / n;
double tmp;
if (x <= 6834308.8393940255) {
double t_1_1 = log1p(x) / n;
tmp = fma(0.5, (pow(log1p(x), 2.0) / (n * n)), fma(0.16666666666666666, pow(t_1_1, 3.0), t_1_1)) - fma(0.16666666666666666, pow(t_0, 3.0), fma(0.5, (pow(log(x), 2.0) / (n * n)), t_0));
} else {
tmp = exp(t_0) / (x * n);
}
return tmp;
}



Bits error versus x



Bits error versus n
if x < 6834308.8393940255Initial program 46.9
Taylor expanded in n around inf 13.7
Simplified13.7
if 6834308.8393940255 < x Initial program 20.5
Taylor expanded in x around inf 1.2
Simplified1.2
Final simplification7.1
herbie shell --seed 2022104
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))