{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\begin{array}{l}
t_0 := \frac{\mathsf{log1p}\left(x\right)}{n}\\
\mathbf{if}\;n \leq -38195.04975221294 \lor \neg \left(n \leq 137840.97768649113\right):\\
\;\;\;\;\left({x}^{\left(\frac{0.5}{n}\right)} + {\left(x + 1\right)}^{\left(\frac{0.5}{n}\right)}\right) \cdot \left(\mathsf{fma}\left(0.125, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{n \cdot n}, \mathsf{fma}\left(0.0026041666666666665, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{4}}{{n}^{4}}, \mathsf{fma}\left(0.5, t_0, 0.020833333333333332 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3}}{{n}^{3}}\right)\right)\right) - \mathsf{fma}\left(0.020833333333333332, \frac{{\log x}^{3}}{{n}^{3}}, \mathsf{fma}\left(0.125, \frac{{\log x}^{2}}{n \cdot n}, \mathsf{fma}\left(0.0026041666666666665, \frac{{\log x}^{4}}{{n}^{4}}, \frac{\log \left(\sqrt{x}\right)}{n}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{t_0} - {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
(let* ((t_0 (/ (log1p x) n)))
(if (or (<= n -38195.04975221294) (not (<= n 137840.97768649113)))
(*
(+ (pow x (/ 0.5 n)) (pow (+ x 1.0) (/ 0.5 n)))
(-
(fma
0.125
(/ (pow (log1p x) 2.0) (* n n))
(fma
0.0026041666666666665
(/ (pow (log1p x) 4.0) (pow n 4.0))
(fma
0.5
t_0
(* 0.020833333333333332 (/ (pow (log1p x) 3.0) (pow n 3.0))))))
(fma
0.020833333333333332
(/ (pow (log x) 3.0) (pow n 3.0))
(fma
0.125
(/ (pow (log x) 2.0) (* n n))
(fma
0.0026041666666666665
(/ (pow (log x) 4.0) (pow n 4.0))
(/ (log (sqrt x)) n))))))
(- (exp t_0) (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 t_0 = log1p(x) / n;
double tmp;
if ((n <= -38195.04975221294) || !(n <= 137840.97768649113)) {
tmp = (pow(x, (0.5 / n)) + pow((x + 1.0), (0.5 / n))) * (fma(0.125, (pow(log1p(x), 2.0) / (n * n)), fma(0.0026041666666666665, (pow(log1p(x), 4.0) / pow(n, 4.0)), fma(0.5, t_0, (0.020833333333333332 * (pow(log1p(x), 3.0) / pow(n, 3.0)))))) - fma(0.020833333333333332, (pow(log(x), 3.0) / pow(n, 3.0)), fma(0.125, (pow(log(x), 2.0) / (n * n)), fma(0.0026041666666666665, (pow(log(x), 4.0) / pow(n, 4.0)), (log(sqrt(x)) / n)))));
} else {
tmp = exp(t_0) - pow(x, (1.0 / n));
}
return tmp;
}



Bits error versus x



Bits error versus n
if n < -38195.0497522129372 or 137840.977686491125 < n Initial program 44.9
Applied add-sqr-sqrt_binary6445.0
Applied add-sqr-sqrt_binary6445.0
Applied difference-of-squares_binary6445.0
Simplified45.0
Simplified45.0
Taylor expanded in n around inf 14.4
Simplified14.4
if -38195.0497522129372 < n < 137840.977686491125Initial program 10.0
Taylor expanded in n around 0 10.0
Simplified1.1
Applied pow1_binary641.1
Final simplification8.6
herbie shell --seed 2022068
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))