{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1.0550413396632783 \cdot 10^{-05}:\\
\;\;\;\;\log \left(\sqrt{e^{{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\right) + \log \left(\sqrt{e^{{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 2.4333254894340803 \cdot 10^{-12}:\\
\;\;\;\;\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}:\\
\;\;\;\;{\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) -1.0550413396632783e-05)
(+
(log (sqrt (exp (- (pow (+ 1.0 x) (/ 1.0 n)) (pow x (/ 1.0 n))))))
(log (sqrt (exp (- (pow (+ 1.0 x) (/ 1.0 n)) (pow x (/ 1.0 n)))))))
(if (<= (/ 1.0 n) 2.4333254894340803e-12)
(+ (- (/ 1.0 (* n x)) (/ 0.5 (* x (* n x)))) (/ (log x) (* x (* n 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) <= -1.0550413396632783e-05) {
tmp = log(sqrt(exp(pow((1.0 + x), (1.0 / n)) - pow(x, (1.0 / n))))) + log(sqrt(exp(pow((1.0 + x), (1.0 / n)) - pow(x, (1.0 / n)))));
} else if ((1.0 / n) <= 2.4333254894340803e-12) {
tmp = ((1.0 / (n * x)) - (0.5 / (x * (n * x)))) + (log(x) / (x * (n * n)));
} else {
tmp = 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) < -1.05504133966327833e-5Initial program 1.0
rmApplied add-log-exp_binary64_4621.4
Applied add-log-exp_binary64_4621.3
Applied diff-log_binary64_5151.3
Simplified1.3
rmApplied add-sqr-sqrt_binary64_4451.3
Applied log-prod_binary64_5091.3
if -1.05504133966327833e-5 < (/.f64 1 n) < 2.43332548943408026e-12Initial program 44.8
Taylor expanded around inf 32.7
Simplified32.6
if 2.43332548943408026e-12 < (/.f64 1 n) Initial program 6.9
Final simplification23.8
herbie shell --seed 2020289
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))