{\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]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{\log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)}\right) \cdot \sqrt[3]{e^{\log \left({\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 r56269 = x;
double r56270 = 1.0;
double r56271 = r56269 + r56270;
double r56272 = n;
double r56273 = r56270 / r56272;
double r56274 = pow(r56271, r56273);
double r56275 = pow(r56269, r56273);
double r56276 = r56274 - r56275;
return r56276;
}
double f(double x, double n) {
double r56277 = 1.0;
double r56278 = n;
double r56279 = r56277 / r56278;
double r56280 = -0.032379292376500446;
bool r56281 = r56279 <= r56280;
double r56282 = x;
double r56283 = r56282 + r56277;
double r56284 = pow(r56283, r56279);
double r56285 = pow(r56282, r56279);
double r56286 = log1p(r56285);
double r56287 = expm1(r56286);
double r56288 = r56284 - r56287;
double r56289 = 1.509943067781132e-13;
bool r56290 = r56279 <= r56289;
double r56291 = 1.0;
double r56292 = r56282 * r56278;
double r56293 = r56291 / r56292;
double r56294 = 0.5;
double r56295 = 2.0;
double r56296 = pow(r56282, r56295);
double r56297 = r56296 * r56278;
double r56298 = r56291 / r56297;
double r56299 = r56291 / r56282;
double r56300 = log(r56299);
double r56301 = pow(r56278, r56295);
double r56302 = r56282 * r56301;
double r56303 = r56300 / r56302;
double r56304 = r56277 * r56303;
double r56305 = fma(r56294, r56298, r56304);
double r56306 = -r56305;
double r56307 = fma(r56277, r56293, r56306);
double r56308 = r56284 - r56285;
double r56309 = cbrt(r56308);
double r56310 = exp(r56308);
double r56311 = log(r56310);
double r56312 = cbrt(r56311);
double r56313 = r56309 * r56312;
double r56314 = log(r56308);
double r56315 = exp(r56314);
double r56316 = cbrt(r56315);
double r56317 = r56313 * r56316;
double r56318 = r56290 ? r56307 : r56317;
double r56319 = r56281 ? r56288 : r56318;
return r56319;
}



Bits error versus x



Bits error versus n
if (/ 1.0 n) < -0.032379292376500446Initial program 0.1
rmApplied expm1-log1p-u0.1
if -0.032379292376500446 < (/ 1.0 n) < 1.509943067781132e-13Initial program 44.4
Taylor expanded around inf 32.9
Simplified32.9
if 1.509943067781132e-13 < (/ 1.0 n) Initial program 24.5
rmApplied add-cube-cbrt24.5
rmApplied add-log-exp24.6
Applied add-log-exp24.7
Applied diff-log24.7
Simplified24.6
rmApplied add-exp-log24.6
Final simplification22.7
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))))