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



Bits error versus x



Bits error versus n
Results
if x < 502.9330801505896Initial program 47.1
Taylor expanded in n around inf 13.8
Simplified13.7
Applied flip--_binary6413.8
Simplified13.8
if 502.9330801505896 < x Initial program 20.8
Taylor expanded in x around inf 1.4
Simplified1.4
Final simplification7.1
herbie shell --seed 2022082
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))