{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\begin{array}{l}
\mathbf{if}\;x \leq 2623.9070389239055:\\
\;\;\;\;\begin{array}{l}
t_0 := \log \left(x + 1\right)\\
\left(0.5 \cdot \frac{{t_0}^{2}}{{n}^{2}} + \left(0.16666666666666666 \cdot \frac{{t_0}^{3}}{{n}^{3}} + \frac{t_0}{n}\right)\right) - \left(0.16666666666666666 \cdot \frac{{\log x}^{3}}{{n}^{3}} + \left(0.5 \cdot \frac{{\log x}^{2}}{{n}^{2}} + \frac{\log x}{n}\right)\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{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
(if (<= x 2623.9070389239055)
(let* ((t_0 (log (+ x 1.0))))
(-
(+
(* 0.5 (/ (pow t_0 2.0) (pow n 2.0)))
(+ (* 0.16666666666666666 (/ (pow t_0 3.0) (pow n 3.0))) (/ t_0 n)))
(+
(* 0.16666666666666666 (/ (pow (log x) 3.0) (pow n 3.0)))
(+ (* 0.5 (/ (pow (log x) 2.0) (pow n 2.0))) (/ (log x) n)))))
(/ (pow x (/ 1.0 n)) (* 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 tmp;
if (x <= 2623.9070389239055) {
double t_0_1 = log(x + 1.0);
tmp = ((0.5 * (pow(t_0_1, 2.0) / pow(n, 2.0))) + ((0.16666666666666666 * (pow(t_0_1, 3.0) / pow(n, 3.0))) + (t_0_1 / n))) - ((0.16666666666666666 * (pow(log(x), 3.0) / pow(n, 3.0))) + ((0.5 * (pow(log(x), 2.0) / pow(n, 2.0))) + (log(x) / n)));
} else {
tmp = pow(x, (1.0 / n)) / (x * n);
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if x < 2623.90703892390547Initial program 47.2
Taylor expanded in n around inf 13.4
if 2623.90703892390547 < x Initial program 21.2
Taylor expanded in x around inf 1.6
Simplified1.6
Final simplification7.1
herbie shell --seed 2021280
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))