{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -5.88550220521482363 \cdot 10^{-12}:\\
\;\;\;\;\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{e^{\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}}\right) + \log \left(\sqrt[3]{e^{\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \le 0.019717068905090208:\\
\;\;\;\;\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(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right) \cdot \sqrt[3]{\frac{{\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} - {\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}}{{x}^{\left(\frac{1}{n}\right)} \cdot \left({x}^{\left(\frac{1}{n}\right)} + {\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right) + {\left(x + 1\right)}^{\left(2 \cdot \frac{1}{n}\right)}}}}\right) \cdot \log \left(e^{\sqrt[3]{{\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 VAR;
if (((1.0 / n) <= -5.885502205214824e-12)) {
VAR = ((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))))) * ((2.0 * log(cbrt(exp(cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))))))) + log(cbrt(exp(cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))))))));
} else {
double VAR_1;
if (((1.0 / n) <= 0.01971706890509021)) {
VAR_1 = (((1.0 / n) / x) - (((0.5 / n) / pow(x, 2.0)) - ((log(x) * 1.0) / (x * pow(n, 2.0)))));
} else {
VAR_1 = ((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)) - pow(x, (1.0 / n))))) * cbrt(((pow(pow((x + 1.0), (1.0 / n)), 3.0) - pow(pow(x, (1.0 / n)), 3.0)) / ((pow(x, (1.0 / n)) * (pow(x, (1.0 / n)) + pow((x + 1.0), (1.0 / n)))) + pow((x + 1.0), (2.0 * (1.0 / n))))))))) * log(exp(cbrt((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -5.885502205214824e-12Initial program 2.8
rmApplied add-cube-cbrt2.8
rmApplied add-log-exp3.0
rmApplied add-cube-cbrt3.0
Applied log-prod3.0
Simplified3.0
if -5.885502205214824e-12 < (/ 1.0 n) < 0.01971706890509021Initial program 44.3
Taylor expanded around inf 32.3
Simplified31.7
if 0.01971706890509021 < (/ 1.0 n) Initial program 4.4
rmApplied add-cube-cbrt4.4
rmApplied add-log-exp4.5
rmApplied add-cube-cbrt4.5
rmApplied flip3--4.5
Simplified4.5
Final simplification23.6
herbie shell --seed 2020102
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))