{\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.591364776215535476182165581533253078392 \cdot 10^{-22}:\\
\;\;\;\;2 \cdot \left(\frac{1}{3} \cdot \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right) + \left(\log \left(\sqrt[3]{\sqrt{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}}\right) + \log \left(\sqrt[3]{\sqrt{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \le 7.083664182173738223528513410730390458454 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{1}{n}}{x} - \left(\frac{\frac{0.5}{n}}{{x}^{2}} - \frac{\log x \cdot 1}{x \cdot {n}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{1}{3} \cdot \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right) + \left(\log \left(\sqrt[3]{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}}}\right) - \log \left(\sqrt[3]{e^{{x}^{\left(\frac{1}{n}\right)}}}\right)\right)\\
\end{array}double f(double x, double n) {
double r82997 = x;
double r82998 = 1.0;
double r82999 = r82997 + r82998;
double r83000 = n;
double r83001 = r82998 / r83000;
double r83002 = pow(r82999, r83001);
double r83003 = pow(r82997, r83001);
double r83004 = r83002 - r83003;
return r83004;
}
double f(double x, double n) {
double r83005 = 1.0;
double r83006 = n;
double r83007 = r83005 / r83006;
double r83008 = -4.5913647762155355e-22;
bool r83009 = r83007 <= r83008;
double r83010 = 2.0;
double r83011 = 0.3333333333333333;
double r83012 = x;
double r83013 = r83012 + r83005;
double r83014 = pow(r83013, r83007);
double r83015 = pow(r83012, r83007);
double r83016 = r83014 - r83015;
double r83017 = r83011 * r83016;
double r83018 = r83010 * r83017;
double r83019 = exp(r83016);
double r83020 = sqrt(r83019);
double r83021 = cbrt(r83020);
double r83022 = log(r83021);
double r83023 = r83022 + r83022;
double r83024 = r83018 + r83023;
double r83025 = 7.083664182173738e-15;
bool r83026 = r83007 <= r83025;
double r83027 = r83007 / r83012;
double r83028 = 0.5;
double r83029 = r83028 / r83006;
double r83030 = pow(r83012, r83010);
double r83031 = r83029 / r83030;
double r83032 = log(r83012);
double r83033 = r83032 * r83005;
double r83034 = pow(r83006, r83010);
double r83035 = r83012 * r83034;
double r83036 = r83033 / r83035;
double r83037 = r83031 - r83036;
double r83038 = r83027 - r83037;
double r83039 = exp(r83014);
double r83040 = cbrt(r83039);
double r83041 = log(r83040);
double r83042 = exp(r83015);
double r83043 = cbrt(r83042);
double r83044 = log(r83043);
double r83045 = r83041 - r83044;
double r83046 = r83018 + r83045;
double r83047 = r83026 ? r83038 : r83046;
double r83048 = r83009 ? r83024 : r83047;
return r83048;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -4.5913647762155355e-22Initial program 3.3
rmApplied add-log-exp3.4
Applied add-log-exp3.4
Applied diff-log3.4
Simplified3.4
rmApplied add-cube-cbrt3.5
Applied log-prod3.5
Simplified3.5
rmApplied pow1/33.4
Applied log-pow3.4
Simplified3.4
rmApplied add-sqr-sqrt3.4
Applied cbrt-prod3.4
Applied log-prod3.4
if -4.5913647762155355e-22 < (/ 1.0 n) < 7.083664182173738e-15Initial program 44.5
Taylor expanded around inf 31.6
Simplified31.0
if 7.083664182173738e-15 < (/ 1.0 n) Initial program 25.5
rmApplied add-log-exp25.5
Applied add-log-exp25.6
Applied diff-log25.6
Simplified25.5
rmApplied add-cube-cbrt26.7
Applied log-prod26.7
Simplified26.7
rmApplied pow1/326.1
Applied log-pow26.1
Simplified26.0
rmApplied exp-diff26.1
Applied cbrt-div26.2
Applied log-div26.2
Final simplification21.9
herbie shell --seed 2020002
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))