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



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -1.3388345966815868e-10 or 1.1878627836950866e-25 < (/ 1.0 n) Initial program 9.7
rmApplied add-cube-cbrt9.7
rmApplied add-cube-cbrt9.7
if -1.3388345966815868e-10 < (/ 1.0 n) < 1.1878627836950866e-25Initial program 44.8
rmApplied add-cube-cbrt44.8
Taylor expanded around inf 32.8
Simplified32.2
Final simplification22.5
herbie shell --seed 2020056
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))