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



Bits error versus x



Bits error versus n
Results
if x < 9093778.054138303Initial program 46.8
Taylor expanded around inf 13.9
Simplified13.9
rmApplied diff-log_binary64_17013.8
if 9093778.054138303 < x Initial program 20.6
Taylor expanded around inf 1.2
Simplified1.2
Final simplification7.0
herbie shell --seed 2021050
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))