{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \leq -116924.1052241744:\\
\;\;\;\;\frac{\frac{1}{x}}{n} \cdot \left(1 + \frac{\log x}{n}\right) - \frac{0.5}{\log \left(e^{x \cdot \left(n \cdot x\right)}\right)}\\
\mathbf{elif}\;n \leq 35146050.636312656:\\
\;\;\;\;{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - {\left({x}^{\left(\frac{1}{\sqrt[3]{n} \cdot \sqrt[3]{n}}\right)}\right)}^{\left(\frac{1}{\sqrt[3]{n}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x} \cdot \left(\frac{1}{n} + \frac{\log x}{n \cdot n}\right) - \frac{0.5}{\log \left(e^{x \cdot \left(n \cdot x\right)}\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 (<= n -116924.1052241744)
(-
(* (/ (/ 1.0 x) n) (+ 1.0 (/ (log x) n)))
(/ 0.5 (log (exp (* x (* n x))))))
(if (<= n 35146050.636312656)
(-
(pow (+ 1.0 x) (/ 1.0 n))
(pow (pow x (/ 1.0 (* (cbrt n) (cbrt n)))) (/ 1.0 (cbrt n))))
(-
(* (/ 1.0 x) (+ (/ 1.0 n) (/ (log x) (* n n))))
(/ 0.5 (log (exp (* x (* n x)))))))))double code(double x, double n) {
return ((double) (((double) pow(((double) (x + 1.0)), (1.0 / n))) - ((double) pow(x, (1.0 / n)))));
}
double code(double x, double n) {
double tmp;
if ((n <= -116924.1052241744)) {
tmp = ((double) (((double) (((1.0 / x) / n) * ((double) (1.0 + (((double) log(x)) / n))))) - (0.5 / ((double) log(((double) exp(((double) (x * ((double) (n * x)))))))))));
} else {
double tmp_1;
if ((n <= 35146050.636312656)) {
tmp_1 = ((double) (((double) pow(((double) (1.0 + x)), (1.0 / n))) - ((double) pow(((double) pow(x, (1.0 / ((double) (((double) cbrt(n)) * ((double) cbrt(n))))))), (1.0 / ((double) cbrt(n)))))));
} else {
tmp_1 = ((double) (((double) ((1.0 / x) * ((double) ((1.0 / n) + (((double) log(x)) / ((double) (n * n))))))) - (0.5 / ((double) log(((double) exp(((double) (x * ((double) (n * x)))))))))));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if n < -116924.105224174404Initial program 44.6
rmApplied add-cube-cbrt_binary6444.6
Applied *-un-lft-identity_binary6444.6
Applied times-frac_binary6444.6
Applied pow-unpow_binary6444.6
Taylor expanded around inf 31.6
Simplified31.0
Taylor expanded around 0 31.5
Simplified30.9
rmApplied add-log-exp_binary6431.1
if -116924.105224174404 < n < 35146050.6363126561Initial program 2.5
rmApplied add-cube-cbrt_binary642.6
Applied *-un-lft-identity_binary642.6
Applied times-frac_binary642.6
Applied pow-unpow_binary642.6
if 35146050.6363126561 < n Initial program 44.6
rmApplied add-cube-cbrt_binary6444.6
Applied *-un-lft-identity_binary6444.6
Applied times-frac_binary6444.6
Applied pow-unpow_binary6444.6
Taylor expanded around inf 32.7
Simplified31.9
rmApplied add-log-exp_binary6432.1
Final simplification23.2
herbie shell --seed 2020205
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))