{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \leq -190663400.55017483 \lor \neg \left(n \leq 1871075736.4773417\right):\\
\;\;\;\;\left(\frac{1}{n \cdot x} - \frac{0.5}{x \cdot \left(n \cdot x\right)}\right) + \frac{\log x}{x \cdot \left(n \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left({\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - e^{\frac{\log x}{n}}\right)}^{3}}\\
\end{array}(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
(FPCore (x n) :precision binary64 (if (or (<= n -190663400.55017483) (not (<= n 1871075736.4773417))) (+ (- (/ 1.0 (* n x)) (/ 0.5 (* x (* n x)))) (/ (log x) (* x (* n n)))) (cbrt (pow (- (pow (+ 1.0 x) (/ 1.0 n)) (exp (/ (log x) n))) 3.0))))
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 tmp;
if ((n <= -190663400.55017483) || !(n <= 1871075736.4773417)) {
tmp = ((1.0 / (n * x)) - (0.5 / (x * (n * x)))) + (log(x) / (x * (n * n)));
} else {
tmp = cbrt(pow((pow((1.0 + x), (1.0 / n)) - exp(log(x) / n)), 3.0));
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if n < -190663400.55017483 or 1871075736.4773417 < n Initial program 45.2
Taylor expanded around inf 33.2
Simplified33.1
if -190663400.55017483 < n < 1871075736.4773417Initial program 3.6
rmApplied pow-to-exp_binary64_1433.6
Simplified3.6
rmApplied add-cbrt-cube_binary64_1103.7
Simplified3.6
Final simplification24.2
herbie shell --seed 2020281
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))