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



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -0.020030344452957847Initial program 0.3
rmApplied add-sqr-sqrt0.3
Applied unpow-prod-down0.4
Applied add-sqr-sqrt0.3
Applied unpow-prod-down0.3
Applied difference-of-squares0.3
rmApplied add-cube-cbrt0.3
rmApplied add-cube-cbrt0.3
rmApplied add-cube-cbrt0.3
if -0.020030344452957847 < (/ 1.0 n) < 1.972146897450667e-15Initial program 45.6
Taylor expanded around inf 33.3
Simplified32.8
if 1.972146897450667e-15 < (/ 1.0 n) Initial program 8.6
rmApplied add-exp-log8.6
Final simplification24.2
herbie shell --seed 2020066
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))