{\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.6345588493135571 \cdot 10^{-23}:\\
\;\;\;\;\log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)\\
\mathbf{elif}\;\frac{1}{n} \le 5.53064647223408922 \cdot 10^{-24}:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-{x}^{\left(\frac{1}{n}\right)}, {x}^{\left(2 \cdot \frac{1}{n}\right)}, {\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)}{\mathsf{fma}\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + {x}^{\left(\frac{1}{n}\right)}, {x}^{\left(\frac{1}{n}\right)}, {\left(x + 1\right)}^{\left(2 \cdot \frac{1}{n}\right)}\right)}\\
\end{array}double f(double x, double n) {
double r54376 = x;
double r54377 = 1.0;
double r54378 = r54376 + r54377;
double r54379 = n;
double r54380 = r54377 / r54379;
double r54381 = pow(r54378, r54380);
double r54382 = pow(r54376, r54380);
double r54383 = r54381 - r54382;
return r54383;
}
double f(double x, double n) {
double r54384 = 1.0;
double r54385 = n;
double r54386 = r54384 / r54385;
double r54387 = -1.634558849313557e-23;
bool r54388 = r54386 <= r54387;
double r54389 = x;
double r54390 = r54389 + r54384;
double r54391 = pow(r54390, r54386);
double r54392 = pow(r54389, r54386);
double r54393 = r54391 - r54392;
double r54394 = exp(r54393);
double r54395 = log(r54394);
double r54396 = 5.530646472234089e-24;
bool r54397 = r54386 <= r54396;
double r54398 = 1.0;
double r54399 = r54389 * r54385;
double r54400 = r54398 / r54399;
double r54401 = 0.5;
double r54402 = 2.0;
double r54403 = pow(r54389, r54402);
double r54404 = r54403 * r54385;
double r54405 = r54398 / r54404;
double r54406 = r54398 / r54389;
double r54407 = log(r54406);
double r54408 = pow(r54385, r54402);
double r54409 = r54389 * r54408;
double r54410 = r54407 / r54409;
double r54411 = r54384 * r54410;
double r54412 = fma(r54401, r54405, r54411);
double r54413 = -r54412;
double r54414 = fma(r54384, r54400, r54413);
double r54415 = -r54392;
double r54416 = r54402 * r54386;
double r54417 = pow(r54389, r54416);
double r54418 = 3.0;
double r54419 = pow(r54391, r54418);
double r54420 = fma(r54415, r54417, r54419);
double r54421 = r54391 + r54392;
double r54422 = pow(r54390, r54416);
double r54423 = fma(r54421, r54392, r54422);
double r54424 = r54420 / r54423;
double r54425 = r54397 ? r54414 : r54424;
double r54426 = r54388 ? r54395 : r54425;
return r54426;
}



Bits error versus x



Bits error versus n
if (/ 1.0 n) < -1.634558849313557e-23Initial program 5.5
rmApplied add-log-exp5.9
Applied add-log-exp5.8
Applied diff-log5.8
Simplified5.8
if -1.634558849313557e-23 < (/ 1.0 n) < 5.530646472234089e-24Initial program 44.6
Taylor expanded around inf 32.6
Simplified32.6
if 5.530646472234089e-24 < (/ 1.0 n) Initial program 13.3
rmApplied sqr-pow13.4
rmApplied flip3--13.5
Simplified13.5
Simplified13.5
Final simplification25.0
herbie shell --seed 2020065 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))