{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \le -210118.23628303723:\\
\;\;\;\;\left(\frac{\frac{1}{n}}{x} + \frac{\frac{1}{n}}{x} \cdot \frac{\log x}{n}\right) - \frac{\frac{\frac{1}{2}}{x \cdot x}}{n}\\
\mathbf{elif}\;n \le -1.1373843048178 \cdot 10^{-311}:\\
\;\;\;\;\mathsf{fma}\left({\left(\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}\right)}^{\left(\frac{1}{n}\right)}, {\left(\sqrt[3]{1 + x}\right)}^{\left(\frac{1}{n}\right)}, -{x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) + \sqrt[3]{\mathsf{fma}\left(-{x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(-{x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(-{x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)}\right)\\
\mathbf{elif}\;n \le 94933831758200.45:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - \mathsf{expm1}\left(\mathsf{log1p}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\frac{1}{n}}{x} + \frac{\frac{1}{n}}{x} \cdot \frac{\log x}{n}\right) - \frac{\frac{\frac{1}{2}}{x \cdot x}}{n}\\
\end{array}double f(double x, double n) {
double r1916096 = x;
double r1916097 = 1.0;
double r1916098 = r1916096 + r1916097;
double r1916099 = n;
double r1916100 = r1916097 / r1916099;
double r1916101 = pow(r1916098, r1916100);
double r1916102 = pow(r1916096, r1916100);
double r1916103 = r1916101 - r1916102;
return r1916103;
}
double f(double x, double n) {
double r1916104 = n;
double r1916105 = -210118.23628303723;
bool r1916106 = r1916104 <= r1916105;
double r1916107 = 1.0;
double r1916108 = r1916107 / r1916104;
double r1916109 = x;
double r1916110 = r1916108 / r1916109;
double r1916111 = log(r1916109);
double r1916112 = r1916111 / r1916104;
double r1916113 = r1916110 * r1916112;
double r1916114 = r1916110 + r1916113;
double r1916115 = 0.5;
double r1916116 = r1916109 * r1916109;
double r1916117 = r1916115 / r1916116;
double r1916118 = r1916117 / r1916104;
double r1916119 = r1916114 - r1916118;
double r1916120 = -1.1373843048178e-311;
bool r1916121 = r1916104 <= r1916120;
double r1916122 = r1916107 + r1916109;
double r1916123 = cbrt(r1916122);
double r1916124 = r1916123 * r1916123;
double r1916125 = pow(r1916124, r1916108);
double r1916126 = pow(r1916123, r1916108);
double r1916127 = 2.0;
double r1916128 = r1916108 / r1916127;
double r1916129 = pow(r1916109, r1916128);
double r1916130 = r1916129 * r1916129;
double r1916131 = -r1916130;
double r1916132 = fma(r1916125, r1916126, r1916131);
double r1916133 = -r1916129;
double r1916134 = fma(r1916133, r1916129, r1916130);
double r1916135 = cbrt(r1916134);
double r1916136 = r1916135 * r1916135;
double r1916137 = r1916135 * r1916136;
double r1916138 = r1916132 + r1916137;
double r1916139 = 94933831758200.45;
bool r1916140 = r1916104 <= r1916139;
double r1916141 = log1p(r1916109);
double r1916142 = r1916141 / r1916104;
double r1916143 = exp(r1916142);
double r1916144 = pow(r1916109, r1916108);
double r1916145 = log1p(r1916144);
double r1916146 = expm1(r1916145);
double r1916147 = r1916143 - r1916146;
double r1916148 = r1916140 ? r1916147 : r1916119;
double r1916149 = r1916121 ? r1916138 : r1916148;
double r1916150 = r1916106 ? r1916119 : r1916149;
return r1916150;
}



Bits error versus x



Bits error versus n
if n < -210118.23628303723 or 94933831758200.45 < n Initial program 45.2
rmApplied expm1-log1p-u45.2
Taylor expanded around inf 32.7
Simplified32.2
if -210118.23628303723 < n < -1.1373843048178e-311Initial program 0.5
rmApplied sqr-pow0.6
Applied add-cube-cbrt0.6
Applied unpow-prod-down0.6
Applied prod-diff0.6
rmApplied add-cube-cbrt0.6
if -1.1373843048178e-311 < n < 94933831758200.45Initial program 26.3
rmApplied expm1-log1p-u26.3
rmApplied pow-to-exp26.3
Simplified3.7
Final simplification19.2
herbie shell --seed 2019143 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))