{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -8.28957440978626294 \cdot 10^{-4}:\\
\;\;\;\;\left(\sqrt[3]{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\log \left(e^{\sqrt[3]{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}}}\right) \cdot \left({\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} + {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \le 2.7376649343181104 \cdot 10^{-11}:\\
\;\;\;\;\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(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\left(\sqrt[3]{\sqrt{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}}} \cdot \sqrt[3]{\sqrt{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}}}\right) \cdot \left({\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} + {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}\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) <= -0.0008289574409786263)) {
VAR = ((cbrt((pow(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n)))) * cbrt((pow(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n))))) * (log(exp(cbrt((pow(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n)))))) * (pow(sqrt((x + 1.0)), (1.0 / n)) + pow(sqrt(x), (1.0 / n)))));
} else {
double VAR_1;
if (((1.0 / n) <= 2.7376649343181104e-11)) {
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(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n)))) * cbrt((pow(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n))))) * ((cbrt(sqrt((pow(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n))))) * cbrt(sqrt((pow(sqrt((x + 1.0)), (1.0 / n)) - pow(sqrt(x), (1.0 / n)))))) * (pow(sqrt((x + 1.0)), (1.0 / n)) + pow(sqrt(x), (1.0 / n)))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -0.0008289574409786263Initial program 0.5
rmApplied add-log-exp0.8
Applied add-log-exp0.7
Applied diff-log0.7
Simplified0.7
rmApplied add-sqr-sqrt0.7
Applied unpow-prod-down0.7
Applied add-sqr-sqrt0.7
Applied unpow-prod-down0.7
Applied difference-of-squares0.7
Applied exp-prod0.7
Applied log-pow0.7
Simplified0.5
rmApplied add-cube-cbrt0.5
Applied associate-*l*0.5
rmApplied add-log-exp0.7
if -0.0008289574409786263 < (/ 1.0 n) < 2.7376649343181104e-11Initial program 44.6
Taylor expanded around inf 32.6
Simplified32.6
if 2.7376649343181104e-11 < (/ 1.0 n) Initial program 6.9
rmApplied add-log-exp7.1
Applied add-log-exp7.1
Applied diff-log7.1
Simplified7.0
rmApplied add-sqr-sqrt7.0
Applied unpow-prod-down7.1
Applied add-sqr-sqrt7.1
Applied unpow-prod-down7.1
Applied difference-of-squares7.1
Applied exp-prod7.1
Applied log-pow7.1
Simplified6.9
rmApplied add-cube-cbrt6.9
Applied associate-*l*6.9
rmApplied add-sqr-sqrt6.9
Applied cbrt-prod6.9
Final simplification23.8
herbie shell --seed 2020078 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))