{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \le -1660.74369281715803:\\
\;\;\;\;\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} + \sqrt{{x}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\left(-0.25 \cdot \left(\frac{1}{{x}^{2} \cdot n} + \frac{\log \left(\frac{1}{x}\right)}{e^{\log \left(x \cdot {n}^{2}\right)}}\right)\right) + \frac{\frac{0.5}{n}}{x}\right)\\
\mathbf{elif}\;n \le 7633188339970.2734:\\
\;\;\;\;\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} + \sqrt{{x}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\left(\sqrt[3]{\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - \sqrt{{x}^{\left(\frac{1}{n}\right)}}} \cdot \sqrt[3]{\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - \sqrt{{x}^{\left(\frac{1}{n}\right)}}}\right) \cdot \sqrt[3]{\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - \sqrt{{x}^{\left(\frac{1}{n}\right)}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} + \sqrt{{x}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\left(-0.25 \cdot \left(\frac{1}{\log \left(e^{{x}^{2} \cdot n}\right)} + \frac{\log \left(\frac{1}{x}\right)}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot {n}^{2}\right)}\right)\right) + \frac{\frac{0.5}{n}}{x}\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 <= -1660.743692817158)) {
temp = ((sqrt(pow((x + 1.0), (1.0 / n))) + sqrt(pow(x, (1.0 / n)))) * (-(0.25 * ((1.0 / (pow(x, 2.0) * n)) + (log((1.0 / x)) / exp(log((x * pow(n, 2.0))))))) + ((0.5 / n) / x)));
} else {
double temp_1;
if ((n <= 7633188339970.273)) {
temp_1 = ((sqrt(pow((x + 1.0), (1.0 / n))) + sqrt(pow(x, (1.0 / n)))) * ((cbrt((sqrt(pow((x + 1.0), (1.0 / n))) - sqrt(pow(x, (1.0 / n))))) * cbrt((sqrt(pow((x + 1.0), (1.0 / n))) - sqrt(pow(x, (1.0 / n)))))) * cbrt((sqrt(pow((x + 1.0), (1.0 / n))) - sqrt(pow(x, (1.0 / n)))))));
} else {
temp_1 = ((sqrt(pow((x + 1.0), (1.0 / n))) + sqrt(pow(x, (1.0 / n)))) * (-(0.25 * ((1.0 / log(exp((pow(x, 2.0) * n)))) + (log((1.0 / x)) / ((cbrt(x) * cbrt(x)) * (cbrt(x) * pow(n, 2.0)))))) + ((0.5 / n) / x)));
}
temp = temp_1;
}
return temp;
}



Bits error versus x



Bits error versus n
Results
if n < -1660.743692817158Initial program 46.0
rmApplied add-sqr-sqrt46.1
Applied add-sqr-sqrt46.1
Applied difference-of-squares46.1
Taylor expanded around inf 32.9
Simplified32.4
rmApplied add-exp-log64.0
Applied pow-exp64.0
Applied add-exp-log64.0
Applied prod-exp64.0
Simplified32.4
if -1660.743692817158 < n < 7633188339970.273Initial program 3.2
rmApplied add-sqr-sqrt3.3
Applied add-sqr-sqrt3.3
Applied difference-of-squares3.3
rmApplied add-cube-cbrt3.3
if 7633188339970.273 < n Initial program 45.3
rmApplied add-sqr-sqrt45.3
Applied add-sqr-sqrt45.3
Applied difference-of-squares45.3
Taylor expanded around inf 33.6
Simplified33.1
rmApplied add-cube-cbrt33.1
Applied associate-*l*33.1
rmApplied add-log-exp33.1
Final simplification24.1
herbie shell --seed 2020066
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))