{\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.121470722263304 \cdot 10^{-07}:\\
\;\;\;\;\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \log \left(e^{\sqrt[3]{\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - \sqrt{{x}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\sqrt{{x}^{\left(\frac{1}{n}\right)}} + \sqrt{{\left(x + 1\right)}^{\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)\\
\mathbf{elif}\;\frac{1}{n} \le 4.0245585845241594 \cdot 10^{-07}:\\
\;\;\;\;\left(\frac{\log x}{n \cdot \left(x \cdot n\right)} + \frac{1}{x \cdot n}\right) - \frac{\frac{\frac{1}{2}}{n}}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)\\
\end{array}double f(double x, double n) {
double r3279382 = x;
double r3279383 = 1.0;
double r3279384 = r3279382 + r3279383;
double r3279385 = n;
double r3279386 = r3279383 / r3279385;
double r3279387 = pow(r3279384, r3279386);
double r3279388 = pow(r3279382, r3279386);
double r3279389 = r3279387 - r3279388;
return r3279389;
}
double f(double x, double n) {
double r3279390 = 1.0;
double r3279391 = n;
double r3279392 = r3279390 / r3279391;
double r3279393 = -1.121470722263304e-07;
bool r3279394 = r3279392 <= r3279393;
double r3279395 = x;
double r3279396 = r3279395 + r3279390;
double r3279397 = pow(r3279396, r3279392);
double r3279398 = pow(r3279395, r3279392);
double r3279399 = r3279397 - r3279398;
double r3279400 = cbrt(r3279399);
double r3279401 = sqrt(r3279397);
double r3279402 = sqrt(r3279398);
double r3279403 = r3279401 - r3279402;
double r3279404 = r3279402 + r3279401;
double r3279405 = r3279403 * r3279404;
double r3279406 = cbrt(r3279405);
double r3279407 = r3279406 * r3279400;
double r3279408 = exp(r3279407);
double r3279409 = log(r3279408);
double r3279410 = r3279400 * r3279409;
double r3279411 = 4.0245585845241594e-07;
bool r3279412 = r3279392 <= r3279411;
double r3279413 = log(r3279395);
double r3279414 = r3279395 * r3279391;
double r3279415 = r3279391 * r3279414;
double r3279416 = r3279413 / r3279415;
double r3279417 = r3279390 / r3279414;
double r3279418 = r3279416 + r3279417;
double r3279419 = 0.5;
double r3279420 = r3279419 / r3279391;
double r3279421 = r3279395 * r3279395;
double r3279422 = r3279420 / r3279421;
double r3279423 = r3279418 - r3279422;
double r3279424 = log1p(r3279395);
double r3279425 = r3279424 / r3279391;
double r3279426 = exp(r3279425);
double r3279427 = r3279426 - r3279398;
double r3279428 = exp(r3279427);
double r3279429 = log(r3279428);
double r3279430 = r3279412 ? r3279423 : r3279429;
double r3279431 = r3279394 ? r3279410 : r3279430;
return r3279431;
}



Bits error versus x



Bits error versus n
Results
if (/ 1 n) < -1.121470722263304e-07Initial program 0.7
rmApplied add-log-exp0.8
rmApplied add-cube-cbrt0.8
Applied exp-prod0.8
Applied log-pow0.8
rmApplied add-sqr-sqrt0.8
Applied add-sqr-sqrt0.8
Applied difference-of-squares0.8
if -1.121470722263304e-07 < (/ 1 n) < 4.0245585845241594e-07Initial program 45.6
rmApplied add-log-exp45.6
Taylor expanded around inf 33.1
Simplified33.1
if 4.0245585845241594e-07 < (/ 1 n) Initial program 24.0
rmApplied add-log-exp24.0
rmApplied add-exp-log24.1
Applied pow-exp24.0
Simplified1.4
Final simplification19.2
herbie shell --seed 2019158 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))