{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \le -46.9258573395225582 \lor \neg \left(n \le 54666412.879635885\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{x \cdot n}, -\mathsf{fma}\left(0.5, \frac{1}{{x}^{2} \cdot n}, 1 \cdot \frac{\log \left(\frac{1}{x}\right)}{x \cdot {n}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(\sqrt[3]{{\left(\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)}^{3}}\right)}\\
\end{array}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 VAR;
if (((n <= -46.92585733952256) || !(n <= 54666412.879635885))) {
VAR = fma(1.0, (1.0 / (x * n)), -fma(0.5, (1.0 / (pow(x, 2.0) * n)), (1.0 * (log((1.0 / x)) / (x * pow(n, 2.0))))));
} else {
VAR = pow(((double) M_E), cbrt(pow(log((pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))), 3.0)));
}
return VAR;
}



Bits error versus x



Bits error versus n
Results
if n < -46.92585733952256 or 54666412.879635885 < n Initial program 45.0
Taylor expanded around inf 33.0
Simplified33.0
if -46.92585733952256 < n < 54666412.879635885Initial program 2.1
rmApplied add-exp-log2.6
rmApplied add-cbrt-cube2.6
Simplified2.6
rmApplied pow12.6
Applied log-pow2.6
Applied unpow-prod-down2.6
Applied cbrt-prod2.6
Applied exp-prod2.6
Simplified2.6
Final simplification24.2
herbie shell --seed 2020103 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))