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



Bits error versus x



Bits error versus n
Results
if (/.f64 1 n) < -5.99448e-9Initial program 1.4
rmApplied add-log-exp_binary64_5391.9
rmApplied add-cube-cbrt_binary64_5451.9
Applied log-prod_binary64_4921.9
Simplified1.9
rmApplied add-cube-cbrt_binary64_5451.9
Applied log-prod_binary64_4921.9
Simplified1.9
rmApplied sub-neg_binary64_5781.9
Applied exp-sum_binary64_5331.9
Applied cbrt-prod_binary64_5411.9
Applied cbrt-prod_binary64_5411.9
Applied log-prod_binary64_4921.9
if -5.99448e-9 < (/.f64 1 n) < 5.11751e-11Initial program 46.2
Taylor expanded around inf 32.3
Simplified32.2
if 5.11751e-11 < (/.f64 1 n) Initial program 7.0
rmApplied flip--_binary64_6007.1
Simplified7.0
Final simplification23.9
herbie shell --seed 2020231
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))