{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -4.062563002021386395830214673147437801342 \cdot 10^{-15}:\\
\;\;\;\;\sqrt[3]{\left({x}^{\left(\frac{\frac{1}{n}}{2}\right)} + \sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} \cdot \left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\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 2.907831219059099599129334134830144599578 \cdot 10^{-26}:\\
\;\;\;\;\left(\frac{\frac{1}{x}}{n} - \left(-\frac{1 \cdot \log x}{x \cdot \left(n \cdot n\right)}\right)\right) - \frac{\frac{0.5}{x}}{x \cdot n}\\
\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 r205212 = x;
double r205213 = 1.0;
double r205214 = r205212 + r205213;
double r205215 = n;
double r205216 = r205213 / r205215;
double r205217 = pow(r205214, r205216);
double r205218 = pow(r205212, r205216);
double r205219 = r205217 - r205218;
return r205219;
}
double f(double x, double n) {
double r205220 = 1.0;
double r205221 = n;
double r205222 = r205220 / r205221;
double r205223 = -4.0625630020213864e-15;
bool r205224 = r205222 <= r205223;
double r205225 = x;
double r205226 = 2.0;
double r205227 = r205222 / r205226;
double r205228 = pow(r205225, r205227);
double r205229 = r205225 + r205220;
double r205230 = pow(r205229, r205222);
double r205231 = sqrt(r205230);
double r205232 = r205228 + r205231;
double r205233 = r205231 - r205228;
double r205234 = r205232 * r205233;
double r205235 = cbrt(r205234);
double r205236 = pow(r205225, r205222);
double r205237 = r205230 - r205236;
double r205238 = cbrt(r205237);
double r205239 = r205238 * r205238;
double r205240 = r205235 * r205239;
double r205241 = 2.9078312190590996e-26;
bool r205242 = r205222 <= r205241;
double r205243 = r205220 / r205225;
double r205244 = r205243 / r205221;
double r205245 = log(r205225);
double r205246 = r205220 * r205245;
double r205247 = r205221 * r205221;
double r205248 = r205225 * r205247;
double r205249 = r205246 / r205248;
double r205250 = -r205249;
double r205251 = r205244 - r205250;
double r205252 = 0.5;
double r205253 = r205252 / r205225;
double r205254 = r205225 * r205221;
double r205255 = r205253 / r205254;
double r205256 = r205251 - r205255;
double r205257 = exp(r205237);
double r205258 = log(r205257);
double r205259 = r205242 ? r205256 : r205258;
double r205260 = r205224 ? r205240 : r205259;
return r205260;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -4.0625630020213864e-15Initial program 1.3
rmApplied add-log-exp1.7
Applied add-log-exp1.7
Applied diff-log1.7
Simplified1.7
rmApplied add-cube-cbrt1.7
Simplified1.7
Simplified1.7
rmApplied sqr-pow1.7
Applied add-sqr-sqrt1.7
Applied difference-of-squares1.7
rmApplied rem-log-exp1.3
if -4.0625630020213864e-15 < (/ 1.0 n) < 2.9078312190590996e-26Initial program 44.7
rmApplied add-log-exp44.7
Applied add-log-exp44.7
Applied diff-log44.7
Simplified44.7
rmApplied add-cube-cbrt44.7
Simplified44.7
Simplified44.7
Taylor expanded around inf 32.2
Simplified31.6
if 2.9078312190590996e-26 < (/ 1.0 n) Initial program 28.1
rmApplied add-log-exp28.2
Applied add-log-exp28.2
Applied diff-log28.2
Simplified28.1
Final simplification22.0
herbie shell --seed 2019179
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))