{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -0.032379292376500446:\\
\;\;\;\;{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - \mathsf{expm1}\left(\mathsf{log1p}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \le 1.50994306778113202 \cdot 10^{-13}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\sqrt[3]{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}} \cdot \sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right) \cdot \sqrt[3]{\log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)}\\
\end{array}double f(double x, double n) {
double r55490 = x;
double r55491 = 1.0;
double r55492 = r55490 + r55491;
double r55493 = n;
double r55494 = r55491 / r55493;
double r55495 = pow(r55492, r55494);
double r55496 = pow(r55490, r55494);
double r55497 = r55495 - r55496;
return r55497;
}
double f(double x, double n) {
double r55498 = 1.0;
double r55499 = n;
double r55500 = r55498 / r55499;
double r55501 = -0.032379292376500446;
bool r55502 = r55500 <= r55501;
double r55503 = x;
double r55504 = r55503 + r55498;
double r55505 = pow(r55504, r55500);
double r55506 = pow(r55503, r55500);
double r55507 = log1p(r55506);
double r55508 = expm1(r55507);
double r55509 = r55505 - r55508;
double r55510 = 1.509943067781132e-13;
bool r55511 = r55500 <= r55510;
double r55512 = 1.0;
double r55513 = r55503 * r55499;
double r55514 = r55512 / r55513;
double r55515 = 0.5;
double r55516 = 2.0;
double r55517 = pow(r55503, r55516);
double r55518 = r55517 * r55499;
double r55519 = r55512 / r55518;
double r55520 = r55512 / r55503;
double r55521 = log(r55520);
double r55522 = pow(r55499, r55516);
double r55523 = r55503 * r55522;
double r55524 = r55521 / r55523;
double r55525 = r55498 * r55524;
double r55526 = fma(r55515, r55519, r55525);
double r55527 = -r55526;
double r55528 = fma(r55498, r55514, r55527);
double r55529 = r55505 - r55506;
double r55530 = log(r55529);
double r55531 = exp(r55530);
double r55532 = cbrt(r55531);
double r55533 = cbrt(r55529);
double r55534 = r55532 * r55533;
double r55535 = exp(r55529);
double r55536 = log(r55535);
double r55537 = cbrt(r55536);
double r55538 = r55534 * r55537;
double r55539 = r55511 ? r55528 : r55538;
double r55540 = r55502 ? r55509 : r55539;
return r55540;
}



Bits error versus x



Bits error versus n
if (/ 1.0 n) < -0.032379292376500446Initial program 0.2
rmApplied expm1-log1p-u0.2
if -0.032379292376500446 < (/ 1.0 n) < 1.509943067781132e-13Initial program 44.5
Taylor expanded around inf 32.8
Simplified32.8
if 1.509943067781132e-13 < (/ 1.0 n) Initial program 7.6
rmApplied add-cube-cbrt7.6
rmApplied add-log-exp7.6
Applied add-log-exp7.8
Applied diff-log7.8
Simplified7.7
rmApplied add-exp-log7.7
Final simplification24.3
herbie shell --seed 2020060 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))