{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \le -185656871.63279188 \lor \neg \left(n \le 1.15099483138983079 \cdot 10^{25}\right):\\
\;\;\;\;\frac{\frac{1}{n}}{x} - \left(\frac{\frac{0.5}{n}}{{x}^{2}} - \frac{\log x \cdot 1}{x \cdot {n}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{\left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} + {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \left(\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)}} + {x}^{\left(\frac{\frac{\frac{1}{n}}{2}}{2}\right)}\right) \cdot \left(\sqrt{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)}} - {x}^{\left(\frac{\frac{\frac{1}{n}}{2}}{2}\right)}\right)\right)}\right) \cdot \sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\right) \cdot \sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\\
\end{array}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 temp;
if (((n <= -185656871.63279188) || !(n <= 1.1509948313898308e+25))) {
temp = (((1.0 / n) / x) - (((0.5 / n) / pow(x, 2.0)) - ((log(x) * 1.0) / (x * pow(n, 2.0)))));
} else {
temp = ((cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))) * cbrt(((cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))) * cbrt(((pow((x + 1.0), ((1.0 / n) / 2.0)) + pow(x, ((1.0 / n) / 2.0))) * ((sqrt(pow((x + 1.0), ((1.0 / n) / 2.0))) + pow(x, (((1.0 / n) / 2.0) / 2.0))) * (sqrt(pow((x + 1.0), ((1.0 / n) / 2.0))) - pow(x, (((1.0 / n) / 2.0) / 2.0))))))) * cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n))))))) * cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))));
}
return temp;
}



Bits error versus x



Bits error versus n
Results
if n < -185656871.63279188 or 1.1509948313898308e+25 < n Initial program 44.8
Taylor expanded around inf 32.7
Simplified32.1
if -185656871.63279188 < n < 1.1509948313898308e+25Initial program 9.8
rmApplied add-cube-cbrt9.8
rmApplied add-cube-cbrt9.8
rmApplied sqr-pow9.8
Applied sqr-pow9.8
Applied difference-of-squares9.8
rmApplied sqr-pow9.8
Applied add-sqr-sqrt9.8
Applied difference-of-squares9.8
Final simplification22.1
herbie shell --seed 2020053
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))