{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -14740.180546711679:\\
\;\;\;\;e^{\sqrt[3]{{\left(\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)}^{3}}}\\
\mathbf{elif}\;\frac{1}{n} \le 3.9744521779096981 \cdot 10^{-14}:\\
\;\;\;\;\frac{1}{x} \cdot \left(\frac{1}{n} - \frac{\log \left(\frac{1}{x}\right)}{{n}^{2}}\right) + \frac{-0.5}{{x}^{2} \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\left({\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} + \sqrt{{x}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\left(\sqrt[3]{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - \sqrt{{x}^{\left(\frac{1}{n}\right)}}} \cdot \sqrt[3]{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - \sqrt{{x}^{\left(\frac{1}{n}\right)}}}\right) \cdot \sqrt[3]{\frac{{\left(\sqrt{x + 1}\right)}^{\left(2 \cdot \frac{1}{n}\right)} + \left(-{x}^{\left(\frac{1}{n}\right)}\right)}{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} + \sqrt{{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) <= -14740.18054671168)) {
VAR = exp(cbrt(pow(log((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))), 3.0)));
} else {
double VAR_1;
if (((1.0 / n) <= 3.974452177909698e-14)) {
VAR_1 = (((1.0 / x) * ((1.0 / n) - (log((1.0 / x)) / pow(n, 2.0)))) + (-0.5 / (pow(x, 2.0) * n)));
} else {
VAR_1 = ((pow(sqrt((x + 1.0)), (1.0 / n)) + sqrt(pow(x, (1.0 / n)))) * ((cbrt((pow(sqrt((x + 1.0)), (1.0 / n)) - sqrt(pow(x, (1.0 / n))))) * cbrt((pow(sqrt((x + 1.0)), (1.0 / n)) - sqrt(pow(x, (1.0 / n)))))) * cbrt(((pow(sqrt((x + 1.0)), (2.0 * (1.0 / n))) + -pow(x, (1.0 / n))) / (pow(sqrt((x + 1.0)), (1.0 / n)) + sqrt(pow(x, (1.0 / n))))))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -14740.18054671168Initial program 0
rmApplied add-exp-log0
rmApplied add-cbrt-cube0
Simplified0
if -14740.18054671168 < (/ 1.0 n) < 3.974452177909698e-14Initial program 44.8
Taylor expanded around inf 33.2
Simplified32.7
if 3.974452177909698e-14 < (/ 1.0 n) Initial program 7.5
rmApplied add-sqr-sqrt7.6
Applied add-sqr-sqrt7.6
Applied unpow-prod-down7.6
Applied difference-of-squares7.6
rmApplied add-cube-cbrt7.6
rmApplied flip--7.6
Simplified7.5
Final simplification23.9
herbie shell --seed 2020103
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))