{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -6.421397779664377473457544443272669576483 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}} \cdot \sqrt[3]{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}}\right) \cdot \sqrt[3]{{\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}}\right) \cdot \left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} + {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)\\
\mathbf{elif}\;\frac{1}{n} \le 1.820657228495789802655210734750766340961 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, \frac{1}{{x}^{2} \cdot n} + \frac{\log \left(\frac{1}{x}\right)}{x \cdot {n}^{2}}, \frac{\frac{0.5}{n}}{x}\right) \cdot \left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} + {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\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 r69103 = x;
double r69104 = 1.0;
double r69105 = r69103 + r69104;
double r69106 = n;
double r69107 = r69104 / r69106;
double r69108 = pow(r69105, r69107);
double r69109 = pow(r69103, r69107);
double r69110 = r69108 - r69109;
return r69110;
}
double f(double x, double n) {
double r69111 = 1.0;
double r69112 = n;
double r69113 = r69111 / r69112;
double r69114 = -6.421397779664377e-10;
bool r69115 = r69113 <= r69114;
double r69116 = x;
double r69117 = r69116 + r69111;
double r69118 = 2.0;
double r69119 = r69113 / r69118;
double r69120 = pow(r69117, r69119);
double r69121 = pow(r69116, r69119);
double r69122 = r69120 - r69121;
double r69123 = cbrt(r69122);
double r69124 = r69123 * r69123;
double r69125 = r69124 * r69123;
double r69126 = r69120 + r69121;
double r69127 = r69125 * r69126;
double r69128 = 1.8206572284957898e-11;
bool r69129 = r69113 <= r69128;
double r69130 = 0.25;
double r69131 = -r69130;
double r69132 = 1.0;
double r69133 = pow(r69116, r69118);
double r69134 = r69133 * r69112;
double r69135 = r69132 / r69134;
double r69136 = r69132 / r69116;
double r69137 = log(r69136);
double r69138 = pow(r69112, r69118);
double r69139 = r69116 * r69138;
double r69140 = r69137 / r69139;
double r69141 = r69135 + r69140;
double r69142 = 0.5;
double r69143 = r69142 / r69112;
double r69144 = r69143 / r69116;
double r69145 = fma(r69131, r69141, r69144);
double r69146 = r69145 * r69126;
double r69147 = pow(r69117, r69113);
double r69148 = pow(r69116, r69113);
double r69149 = r69147 - r69148;
double r69150 = exp(r69149);
double r69151 = log(r69150);
double r69152 = r69129 ? r69146 : r69151;
double r69153 = r69115 ? r69127 : r69152;
return r69153;
}



Bits error versus x



Bits error versus n
if (/ 1.0 n) < -6.421397779664377e-10Initial program 1.1
rmApplied add-log-exp1.3
Applied add-log-exp1.3
Applied diff-log1.3
Simplified1.3
rmApplied sqr-pow1.3
Applied sqr-pow1.3
Applied difference-of-squares1.3
Applied exp-prod1.3
Applied log-pow1.3
Simplified1.1
rmApplied add-cube-cbrt1.1
if -6.421397779664377e-10 < (/ 1.0 n) < 1.8206572284957898e-11Initial program 45.6
rmApplied add-log-exp45.6
Applied add-log-exp45.6
Applied diff-log45.6
Simplified45.6
rmApplied sqr-pow45.6
Applied sqr-pow45.6
Applied difference-of-squares45.6
Applied exp-prod45.6
Applied log-pow45.6
Simplified45.6
Taylor expanded around inf 33.3
Simplified32.8
if 1.8206572284957898e-11 < (/ 1.0 n) Initial program 24.8
rmApplied add-log-exp24.9
Applied add-log-exp24.9
Applied diff-log24.9
Simplified24.8
Final simplification22.4
herbie shell --seed 2019362 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))