{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;x \leq 96823.49085771796:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\
\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 (<= x 96823.49085771796) (/ (log (/ (+ x 1.0) x)) n) (/ (pow x (/ 1.0 n)) (* x n))))
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 (x <= 96823.49085771796) {
tmp = log((x + 1.0) / x) / n;
} else {
tmp = pow(x, (1.0 / n)) / (x * n);
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if x < 96823.490857717959Initial program 47.4
Taylor expanded around inf 13.4
Simplified13.4
rmApplied diff-log_binary64_51113.4
Simplified13.4
if 96823.490857717959 < x Initial program 20.5
Taylor expanded around inf 1.2
Simplified1.2
Final simplification6.9
herbie shell --seed 2021045
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))