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



Bits error versus x



Bits error versus n
Results
if n < -61669447.7829862013 or 1919560313.26220345 < n Initial program 45.0
Taylor expanded around inf 32.4
Simplified32.3
rmApplied *-un-lft-identity_binary6432.3
Applied times-frac_binary6432.2
Applied *-un-lft-identity_binary6432.2
Applied times-frac_binary6431.7
Applied distribute-lft-out--_binary6431.7
rmApplied add-log-exp_binary6431.6
if -61669447.7829862013 < n < 1919560313.26220345Initial program 3.2
rmApplied pow-to-exp_binary643.3
Simplified3.3
Taylor expanded around 0 22.0
Simplified2.3
Final simplification23.1
herbie shell --seed 2020253
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))