{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -2.24942559102901105 \cdot 10^{-18}:\\
\;\;\;\;\left({\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} + {\left(\sqrt{x}\right)}^{\left(\frac{2 \cdot \frac{1}{n}}{2}\right)}\right) \cdot \left(\left(-{\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}\right) + {\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)}\right) + \mathsf{fma}\left({\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}, -{\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}, {\left(\sqrt{x}\right)}^{\left(2 \cdot \frac{1}{n}\right)}\right)\\
\mathbf{elif}\;\frac{1}{n} \le 2.41213401008201 \cdot 10^{-10}:\\
\;\;\;\;\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}:\\
\;\;\;\;\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)}\\
\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) <= -2.249425591029011e-18)) {
VAR = (((pow(sqrt((x + 1.0)), (1.0 / n)) + pow(sqrt(x), ((2.0 * (1.0 / n)) / 2.0))) * (-pow(sqrt(x), (1.0 / n)) + pow(sqrt((x + 1.0)), (1.0 / n)))) + fma(pow(sqrt(x), (1.0 / n)), -pow(sqrt(x), (1.0 / n)), pow(sqrt(x), (2.0 * (1.0 / n)))));
} else {
double VAR_1;
if (((1.0 / n) <= 2.412134010082013e-10)) {
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 = ((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)))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -2.249425591029011e-18Initial program 4.4
rmApplied add-sqr-sqrt4.4
Applied unpow-prod-down4.5
Applied *-un-lft-identity4.5
Applied unpow-prod-down4.5
Applied prod-diff4.5
Simplified4.4
Simplified4.5
rmApplied sqr-pow4.5
Applied add-sqr-sqrt4.5
Applied unpow-prod-down4.5
Applied difference-of-squares4.5
Simplified4.5
if -2.249425591029011e-18 < (/ 1.0 n) < 2.412134010082013e-10Initial program 44.8
Taylor expanded around inf 32.7
Simplified32.7
if 2.412134010082013e-10 < (/ 1.0 n) Initial program 5.8
rmApplied flip3--5.9
Simplified5.9
Final simplification24.4
herbie shell --seed 2020106 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))