{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \leq -19797961.77181827 \lor \neg \left(n \leq 829455.0002747169\right):\\
\;\;\;\;\frac{1}{x} \cdot \left(\frac{1}{n} - \frac{0.5}{n \cdot x}\right) + \frac{\log x}{x \cdot \left(n \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - \sqrt{e^{\frac{\log x}{n}}} \cdot \sqrt{e^{\frac{\log x}{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 (or (<= n -19797961.77181827) (not (<= n 829455.0002747169)))
(+ (* (/ 1.0 x) (- (/ 1.0 n) (/ 0.5 (* n x)))) (/ (log x) (* x (* n n))))
(-
(pow (+ 1.0 x) (/ 1.0 n))
(* (sqrt (exp (/ (log x) n))) (sqrt (exp (/ (log 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 ((n <= -19797961.77181827) || !(n <= 829455.0002747169)) {
tmp = ((1.0 / x) * ((1.0 / n) - (0.5 / (n * x)))) + (log(x) / (x * (n * n)));
} else {
tmp = pow((1.0 + x), (1.0 / n)) - (sqrt(exp(log(x) / n)) * sqrt(exp(log(x) / n)));
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if n < -19797961.771818269 or 829455.00027471688 < n Initial program 45.1
Taylor expanded around inf 32.4
Simplified32.3
rmApplied *-un-lft-identity_binary6432.3
Applied times-frac_binary6432.3
Applied *-un-lft-identity_binary6432.3
Applied times-frac_binary6431.7
Applied distribute-lft-out--_binary6431.7
if -19797961.771818269 < n < 829455.00027471688Initial program 2.8
rmApplied add-exp-log_binary642.9
Applied pow-exp_binary642.9
Simplified2.9
rmApplied add-sqr-sqrt_binary642.9
Final simplification23.3
herbie shell --seed 2020224
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))