{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -2.839659274028174 \cdot 10^{-16}:\\
\;\;\;\;2 \cdot \left(0.3333333333333333 \cdot \left({\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right) + \log \left(\sqrt[3]{e^{{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 1.6431039643536093 \cdot 10^{-27}:\\
\;\;\;\;\frac{1}{n \cdot x} + \left(\frac{1}{n \cdot n} \cdot \left(\frac{\log 1}{x} + \frac{\log x}{x}\right) - \frac{0.5}{x \cdot \left(n \cdot x\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{{\left(1 + x\right)}^{\left(\frac{1}{n} \cdot 2\right)} - {x}^{\left(\frac{1}{n} \cdot 2\right)}}{{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} + {x}^{\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) -2.839659274028174e-16)
(+
(*
2.0
(* 0.3333333333333333 (- (pow (+ 1.0 x) (/ 1.0 n)) (pow x (/ 1.0 n)))))
(log (cbrt (exp (- (pow (+ 1.0 x) (/ 1.0 n)) (pow x (/ 1.0 n)))))))
(if (<= (/ 1.0 n) 1.6431039643536093e-27)
(+
(/ 1.0 (* n x))
(-
(* (/ 1.0 (* n n)) (+ (/ (log 1.0) x) (/ (log x) x)))
(/ 0.5 (* x (* n x)))))
(log
(exp
(/
(- (pow (+ 1.0 x) (* (/ 1.0 n) 2.0)) (pow x (* (/ 1.0 n) 2.0)))
(+ (pow (+ 1.0 x) (/ 1.0 n)) (pow x (/ 1.0 n)))))))))double code(double x, double n) {
return ((double) (((double) pow(((double) (x + 1.0)), (1.0 / n))) - ((double) pow(x, (1.0 / n)))));
}
double code(double x, double n) {
double tmp;
if (((1.0 / n) <= -2.839659274028174e-16)) {
tmp = ((double) (((double) (2.0 * ((double) (0.3333333333333333 * ((double) (((double) pow(((double) (1.0 + x)), (1.0 / n))) - ((double) pow(x, (1.0 / n))))))))) + ((double) log(((double) cbrt(((double) exp(((double) (((double) pow(((double) (1.0 + x)), (1.0 / n))) - ((double) pow(x, (1.0 / n)))))))))))));
} else {
double tmp_1;
if (((1.0 / n) <= 1.6431039643536093e-27)) {
tmp_1 = ((double) ((1.0 / ((double) (n * x))) + ((double) (((double) ((1.0 / ((double) (n * n))) * ((double) ((((double) log(1.0)) / x) + (((double) log(x)) / x))))) - (0.5 / ((double) (x * ((double) (n * x)))))))));
} else {
tmp_1 = ((double) log(((double) exp((((double) (((double) pow(((double) (1.0 + x)), ((double) ((1.0 / n) * 2.0)))) - ((double) pow(x, ((double) ((1.0 / n) * 2.0)))))) / ((double) (((double) pow(((double) (1.0 + x)), (1.0 / n))) + ((double) pow(x, (1.0 / n))))))))));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -2.83965927402817416e-16Initial program Error: 3.6 bits
rmApplied add-log-expError: 4.1 bits
Applied add-log-expError: 4.0 bits
Applied diff-logError: 4.0 bits
SimplifiedError: 4.0 bits
rmApplied add-cube-cbrtError: 4.1 bits
Applied log-prodError: 4.1 bits
SimplifiedError: 4.1 bits
rmApplied pow1/3Error: 4.1 bits
Applied log-powError: 4.1 bits
SimplifiedError: 4.0 bits
if -2.83965927402817416e-16 < (/ 1.0 n) < 1.64310396435360927e-27Initial program Error: 44.9 bits
Taylor expanded around inf Error: 32.5 bits
SimplifiedError: 32.4 bits
if 1.64310396435360927e-27 < (/ 1.0 n) Initial program Error: 15.0 bits
rmApplied add-log-expError: 15.1 bits
Applied add-log-expError: 15.1 bits
Applied diff-logError: 15.2 bits
SimplifiedError: 15.1 bits
rmApplied flip--Error: 15.1 bits
SimplifiedError: 15.1 bits
Final simplificationError: 24.5 bits
herbie shell --seed 2020204
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))