{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \leq -3292888712184467.5 \lor \neg \left(n \leq 28730378.808545448\right):\\
\;\;\;\;\left(\frac{\frac{1}{x}}{n} - \frac{0.5}{x \cdot \left(n \cdot x\right)}\right) + \frac{\log x}{x \cdot \left(n \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - e^{\frac{\log x}{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 (or (<= n -3292888712184467.5) (not (<= n 28730378.808545448))) (+ (- (/ (/ 1.0 x) n) (/ 0.5 (* x (* n x)))) (/ (log x) (* x (* n n)))) (- (pow (+ 1.0 x) (/ 1.0 n)) (exp (/ (log 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 ((n <= -3292888712184467.5) || !(n <= 28730378.808545448)) {
tmp = (((1.0 / x) / n) - (0.5 / (x * (n * x)))) + (log(x) / (x * (n * n)));
} else {
tmp = pow((1.0 + x), (1.0 / n)) - exp(log(x) / n);
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if n < -3292888712184467.5 or 28730378.808545448 < n Initial program 45.2
Taylor expanded around inf 32.1
Simplified32.0
rmApplied associate-/r*_binary64_2331.5
if -3292888712184467.5 < n < 28730378.808545448Initial program 4.4
rmApplied pow-to-exp_binary64_1484.4
Simplified4.4
Final simplification23.3
herbie shell --seed 2020277
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))