{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -9.91421720864949135 \cdot 10^{-7} \lor \neg \left(\frac{1}{n} \le 1.63989863279117905 \cdot 10^{-10}\right):\\
\;\;\;\;\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]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{x \cdot n}, -\mathsf{fma}\left(0.5, \frac{1}{{x}^{2} \cdot n}, 1 \cdot \frac{\log \left(\frac{1}{x}\right)}{x \cdot {n}^{2}}\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) <= -9.914217208649491e-07) || !((1.0 / n) <= 1.639898632791179e-10))) {
temp = ((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((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))));
} else {
temp = fma(1.0, (1.0 / (x * n)), -fma(0.5, (1.0 / (pow(x, 2.0) * n)), (1.0 * (log((1.0 / x)) / (x * pow(n, 2.0))))));
}
return temp;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -9.914217208649491e-07 or 1.639898632791179e-10 < (/ 1.0 n) Initial program 8.4
rmApplied add-cube-cbrt8.4
if -9.914217208649491e-07 < (/ 1.0 n) < 1.639898632791179e-10Initial program 44.4
Taylor expanded around inf 32.5
Simplified32.5
Final simplification22.2
herbie shell --seed 2020049 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))