{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -8.677989282032493185982098635872228342691 \cdot 10^{-8}:\\
\;\;\;\;\log \left(\sqrt{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\right) + \frac{1}{2} \cdot \log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)\\
\mathbf{elif}\;\frac{1}{n} \le 3.779819658150885208826442400589736548601 \cdot 10^{-21}:\\
\;\;\;\;\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}:\\
\;\;\;\;\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\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)\\
\end{array}double f(double x, double n) {
double r68901 = x;
double r68902 = 1.0;
double r68903 = r68901 + r68902;
double r68904 = n;
double r68905 = r68902 / r68904;
double r68906 = pow(r68903, r68905);
double r68907 = pow(r68901, r68905);
double r68908 = r68906 - r68907;
return r68908;
}
double f(double x, double n) {
double r68909 = 1.0;
double r68910 = n;
double r68911 = r68909 / r68910;
double r68912 = -8.677989282032493e-08;
bool r68913 = r68911 <= r68912;
double r68914 = x;
double r68915 = r68914 + r68909;
double r68916 = pow(r68915, r68911);
double r68917 = pow(r68914, r68911);
double r68918 = r68916 - r68917;
double r68919 = exp(r68918);
double r68920 = sqrt(r68919);
double r68921 = log(r68920);
double r68922 = 0.5;
double r68923 = log(r68919);
double r68924 = r68922 * r68923;
double r68925 = r68921 + r68924;
double r68926 = 3.779819658150885e-21;
bool r68927 = r68911 <= r68926;
double r68928 = 1.0;
double r68929 = r68914 * r68910;
double r68930 = r68928 / r68929;
double r68931 = 0.5;
double r68932 = 2.0;
double r68933 = pow(r68914, r68932);
double r68934 = r68933 * r68910;
double r68935 = r68928 / r68934;
double r68936 = r68928 / r68914;
double r68937 = log(r68936);
double r68938 = pow(r68910, r68932);
double r68939 = r68914 * r68938;
double r68940 = r68937 / r68939;
double r68941 = r68909 * r68940;
double r68942 = fma(r68931, r68935, r68941);
double r68943 = -r68942;
double r68944 = fma(r68909, r68930, r68943);
double r68945 = cbrt(r68918);
double r68946 = r68945 * r68945;
double r68947 = r68945 * r68946;
double r68948 = r68927 ? r68944 : r68947;
double r68949 = r68913 ? r68925 : r68948;
return r68949;
}



Bits error versus x



Bits error versus n
if (/ 1.0 n) < -8.677989282032493e-08Initial program 0.8
rmApplied add-log-exp1.0
Applied add-log-exp0.9
Applied diff-log0.9
Simplified0.9
rmApplied add-sqr-sqrt0.9
Applied log-prod0.9
rmApplied pow10.9
Applied sqrt-pow10.9
Applied log-pow0.9
Simplified0.9
rmApplied add-log-exp1.0
Applied add-log-exp0.9
Applied diff-log0.9
Simplified0.9
if -8.677989282032493e-08 < (/ 1.0 n) < 3.779819658150885e-21Initial program 45.6
Taylor expanded around inf 33.3
Simplified33.3
if 3.779819658150885e-21 < (/ 1.0 n) Initial program 27.1
rmApplied add-log-exp27.3
Applied add-log-exp27.3
Applied diff-log27.3
Simplified27.2
rmApplied add-cube-cbrt27.2
Applied exp-prod27.2
Applied log-pow27.1
Simplified27.1
Final simplification23.1
herbie shell --seed 2019356 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))