{\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:\\
\;\;\;\;\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)\\
\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}}{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + {x}^{\left(\frac{1}{n}\right)}, {\left(x + 1\right)}^{\left(2 \cdot \frac{1}{n}\right)}\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 = 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))))));
} 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)) / fma(pow(x, (1.0 / n)), (pow((x + 1.0), (1.0 / n)) + pow(x, (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
Simplified32.3
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 simplification24.0
herbie shell --seed 2020102 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))