{\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.231628956235088061333727595114684305599 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \log \left(\sqrt[3]{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\right) + \left(\log \left(\sqrt[3]{\sqrt{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}}\right) + \log \left(\sqrt[3]{\sqrt{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \le 6.09236300335944052714885559004874807172 \cdot 10^{-29}:\\
\;\;\;\;\left(\frac{1}{x \cdot n} - \frac{0.5}{{x}^{2} \cdot n}\right) - \frac{-\log x}{x \cdot {n}^{2}} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - \left(\sqrt[3]{{x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{{x}^{\left(\frac{1}{n}\right)}}\right) \cdot \sqrt[3]{{x}^{\left(\frac{1}{n}\right)}}}\right)\\
\end{array}double f(double x, double n) {
double r53587 = x;
double r53588 = 1.0;
double r53589 = r53587 + r53588;
double r53590 = n;
double r53591 = r53588 / r53590;
double r53592 = pow(r53589, r53591);
double r53593 = pow(r53587, r53591);
double r53594 = r53592 - r53593;
return r53594;
}
double f(double x, double n) {
double r53595 = 1.0;
double r53596 = n;
double r53597 = r53595 / r53596;
double r53598 = -1.231628956235088e-07;
bool r53599 = r53597 <= r53598;
double r53600 = 2.0;
double r53601 = x;
double r53602 = r53601 + r53595;
double r53603 = pow(r53602, r53597);
double r53604 = pow(r53601, r53597);
double r53605 = r53603 - r53604;
double r53606 = exp(r53605);
double r53607 = cbrt(r53606);
double r53608 = log(r53607);
double r53609 = r53600 * r53608;
double r53610 = sqrt(r53606);
double r53611 = cbrt(r53610);
double r53612 = log(r53611);
double r53613 = r53612 + r53612;
double r53614 = r53609 + r53613;
double r53615 = 6.09236300335944e-29;
bool r53616 = r53597 <= r53615;
double r53617 = r53601 * r53596;
double r53618 = r53595 / r53617;
double r53619 = 0.5;
double r53620 = pow(r53601, r53600);
double r53621 = r53620 * r53596;
double r53622 = r53619 / r53621;
double r53623 = r53618 - r53622;
double r53624 = log(r53601);
double r53625 = -r53624;
double r53626 = pow(r53596, r53600);
double r53627 = r53601 * r53626;
double r53628 = r53625 / r53627;
double r53629 = r53628 * r53595;
double r53630 = r53623 - r53629;
double r53631 = cbrt(r53604);
double r53632 = r53631 * r53631;
double r53633 = r53632 * r53631;
double r53634 = r53603 - r53633;
double r53635 = exp(r53634);
double r53636 = log(r53635);
double r53637 = r53616 ? r53630 : r53636;
double r53638 = r53599 ? r53614 : r53637;
return r53638;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -1.231628956235088e-07Initial program 0.7
rmApplied add-log-exp0.8
Applied add-log-exp0.8
Applied diff-log0.8
Simplified0.8
rmApplied add-cube-cbrt0.8
Applied log-prod0.8
Simplified0.8
rmApplied add-sqr-sqrt0.8
Applied cbrt-prod0.8
Applied log-prod0.8
if -1.231628956235088e-07 < (/ 1.0 n) < 6.09236300335944e-29Initial program 43.9
rmApplied add-log-exp43.9
Applied add-log-exp43.9
Applied diff-log43.9
Simplified43.9
Taylor expanded around inf 32.1
Simplified32.1
if 6.09236300335944e-29 < (/ 1.0 n) Initial program 27.4
rmApplied add-log-exp27.4
Applied add-log-exp27.5
Applied diff-log27.5
Simplified27.5
rmApplied add-cube-cbrt27.6
Final simplification22.4
herbie shell --seed 2019209
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))