{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -1.573264323221321940469903236644308698369 \cdot 10^{-23}:\\
\;\;\;\;\left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} + {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{e^{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}}}\right) + \log \left(\sqrt[3]{e^{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}}}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \le 2.331213512681894439398036102681617494142 \cdot 10^{-13}:\\
\;\;\;\;\frac{1}{x} \cdot \left(\frac{1}{n} - \frac{-\log x}{{n}^{2}}\right) - \frac{0.5}{{x}^{2} \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} + {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \log \left(e^{\frac{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}{{x}^{\left(\frac{\frac{1}{n}}{2}\right)} + {\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)}}}\right)\\
\end{array}double f(double x, double n) {
double r71390 = x;
double r71391 = 1.0;
double r71392 = r71390 + r71391;
double r71393 = n;
double r71394 = r71391 / r71393;
double r71395 = pow(r71392, r71394);
double r71396 = pow(r71390, r71394);
double r71397 = r71395 - r71396;
return r71397;
}
double f(double x, double n) {
double r71398 = 1.0;
double r71399 = n;
double r71400 = r71398 / r71399;
double r71401 = -1.573264323221322e-23;
bool r71402 = r71400 <= r71401;
double r71403 = x;
double r71404 = r71403 + r71398;
double r71405 = 2.0;
double r71406 = r71400 / r71405;
double r71407 = pow(r71404, r71406);
double r71408 = pow(r71403, r71406);
double r71409 = r71407 + r71408;
double r71410 = r71407 - r71408;
double r71411 = exp(r71410);
double r71412 = cbrt(r71411);
double r71413 = log(r71412);
double r71414 = r71405 * r71413;
double r71415 = r71414 + r71413;
double r71416 = r71409 * r71415;
double r71417 = 2.3312135126818944e-13;
bool r71418 = r71400 <= r71417;
double r71419 = r71398 / r71403;
double r71420 = 1.0;
double r71421 = r71420 / r71399;
double r71422 = log(r71403);
double r71423 = -r71422;
double r71424 = pow(r71399, r71405);
double r71425 = r71423 / r71424;
double r71426 = r71421 - r71425;
double r71427 = r71419 * r71426;
double r71428 = 0.5;
double r71429 = pow(r71403, r71405);
double r71430 = r71429 * r71399;
double r71431 = r71428 / r71430;
double r71432 = r71427 - r71431;
double r71433 = pow(r71404, r71400);
double r71434 = pow(r71403, r71400);
double r71435 = r71433 - r71434;
double r71436 = r71408 + r71407;
double r71437 = r71435 / r71436;
double r71438 = exp(r71437);
double r71439 = log(r71438);
double r71440 = r71409 * r71439;
double r71441 = r71418 ? r71432 : r71440;
double r71442 = r71402 ? r71416 : r71441;
return r71442;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -1.573264323221322e-23Initial program 3.5
rmApplied sqr-pow3.6
Applied sqr-pow3.5
Applied difference-of-squares3.5
rmApplied add-log-exp3.7
Applied add-log-exp3.6
Applied diff-log3.7
Simplified3.6
rmApplied add-cube-cbrt3.7
Applied log-prod3.7
Simplified3.7
if -1.573264323221322e-23 < (/ 1.0 n) < 2.3312135126818944e-13Initial program 44.8
Taylor expanded around inf 32.6
Simplified31.9
if 2.3312135126818944e-13 < (/ 1.0 n) Initial program 25.2
rmApplied sqr-pow25.3
Applied sqr-pow25.2
Applied difference-of-squares25.2
rmApplied add-log-exp25.3
Applied add-log-exp25.3
Applied diff-log25.3
Simplified25.3
rmApplied flip--28.0
Simplified28.0
Simplified28.0
Final simplification23.1
herbie shell --seed 2019326 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))