{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;x \leq 8.40015892724182 \cdot 10^{-225}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{{x}^{3}}{n}, \frac{x}{n}\right) - \mathsf{fma}\left(0.5, x \cdot \frac{x}{n}, t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := e^{t_0}\\
\mathbf{if}\;x \leq 3.820976062708217 \cdot 10^{-206}:\\
\;\;\;\;\frac{x}{n} + \left(1 - t_1\right)\\
\mathbf{elif}\;x \leq 3872.7799695531517:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt{x + 1}\\
\frac{\log \left(\frac{t_2}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \log \left(\frac{t_2}{\sqrt[3]{x}}\right)}{n}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{x \cdot n}\\
\end{array}\\
\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 (/ (log x) n)))
(if (<= x 8.40015892724182e-225)
(-
(fma 0.3333333333333333 (/ (pow x 3.0) n) (/ x n))
(fma 0.5 (* x (/ x n)) t_0))
(let* ((t_1 (exp t_0)))
(if (<= x 3.820976062708217e-206)
(+ (/ x n) (- 1.0 t_1))
(if (<= x 3872.7799695531517)
(let* ((t_2 (sqrt (+ x 1.0))))
(/
(+ (log (/ t_2 (* (cbrt x) (cbrt x)))) (log (/ t_2 (cbrt x))))
n))
(/ t_1 (* x 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 = log(x) / n;
double tmp;
if (x <= 8.40015892724182e-225) {
tmp = fma(0.3333333333333333, (pow(x, 3.0) / n), (x / n)) - fma(0.5, (x * (x / n)), t_0);
} else {
double t_1 = exp(t_0);
double tmp_1;
if (x <= 3.820976062708217e-206) {
tmp_1 = (x / n) + (1.0 - t_1);
} else if (x <= 3872.7799695531517) {
double t_2 = sqrt(x + 1.0);
tmp_1 = (log(t_2 / (cbrt(x) * cbrt(x))) + log(t_2 / cbrt(x))) / n;
} else {
tmp_1 = t_1 / (x * n);
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus n
if x < 8.4001589272418198e-225Initial program 40.8
Taylor expanded in n around inf 20.3
Simplified20.3
Taylor expanded in x around 0 20.3
Simplified20.3
if 8.4001589272418198e-225 < x < 3.82097606270821704e-206Initial program 44.5
Taylor expanded in x around 0 44.1
Simplified44.1
if 3.82097606270821704e-206 < x < 3872.77996955315166Initial program 49.9
Taylor expanded in n around inf 11.0
Simplified11.0
Applied log1p-udef_binary6411.0
Applied diff-log_binary6410.9
Applied add-cube-cbrt_binary6411.0
Applied add-sqr-sqrt_binary6411.0
Applied times-frac_binary6411.0
Applied log-prod_binary6411.1
if 3872.77996955315166 < x Initial program 21.0
Taylor expanded in x around inf 1.4
Simplified1.4
Final simplification8.1
herbie shell --seed 2022081
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))