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



Bits error versus x



Bits error versus n
Results
if (/.f64 1 n) < -0.00432654119502486837Initial program 0.5
rmApplied add-sqr-sqrt_binary64_1000.5
Applied sqr-pow_binary64_500.5
Applied difference-of-squares_binary64_470.5
Simplified0.5
Simplified0.5
if -0.00432654119502486837 < (/.f64 1 n) < 1.2018617314349125e-6Initial program 44.3
Taylor expanded around inf 32.6
Simplified32.5
rmApplied associate-/r*_binary64_2231.8
if 1.2018617314349125e-6 < (/.f64 1 n) Initial program 5.2
rmApplied flip3--_binary64_825.2
Simplified5.2
Final simplification23.1
herbie shell --seed 2020355
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))