double f(double x, double n) {
double r14908862 = x;
double r14908863 = 1.0;
double r14908864 = r14908862 + r14908863;
double r14908865 = n;
double r14908866 = r14908863 / r14908865;
double r14908867 = pow(r14908864, r14908866);
double r14908868 = pow(r14908862, r14908866);
double r14908869 = r14908867 - r14908868;
return r14908869;
}
double f(double x, double n) {
double r14908870 = n;
double r14908871 = -1650.055784837749;
bool r14908872 = r14908870 <= r14908871;
double r14908873 = x;
double r14908874 = 1.0;
double r14908875 = r14908874 / r14908870;
double r14908876 = 2.0;
double r14908877 = r14908875 / r14908876;
double r14908878 = pow(r14908873, r14908877);
double r14908879 = log(r14908878);
double r14908880 = exp(r14908879);
double r14908881 = r14908873 + r14908874;
double r14908882 = pow(r14908881, r14908877);
double r14908883 = r14908880 + r14908882;
double r14908884 = 0.25;
double r14908885 = r14908884 / r14908870;
double r14908886 = r14908885 / r14908870;
double r14908887 = log(r14908873);
double r14908888 = r14908887 / r14908873;
double r14908889 = 0.5;
double r14908890 = r14908873 * r14908870;
double r14908891 = r14908889 / r14908890;
double r14908892 = fma(r14908886, r14908888, r14908891);
double r14908893 = r14908873 * r14908873;
double r14908894 = r14908885 / r14908893;
double r14908895 = r14908892 - r14908894;
double r14908896 = r14908883 * r14908895;
double r14908897 = 9.8058607172592e-311;
bool r14908898 = r14908870 <= r14908897;
double r14908899 = r14908882 - r14908880;
double r14908900 = r14908899 * r14908899;
double r14908901 = r14908900 * r14908899;
double r14908902 = cbrt(r14908901);
double r14908903 = r14908883 * r14908902;
double r14908904 = 271.3240147216949;
bool r14908905 = r14908870 <= r14908904;
double r14908906 = log1p(r14908873);
double r14908907 = r14908906 / r14908870;
double r14908908 = exp(r14908907);
double r14908909 = pow(r14908873, r14908875);
double r14908910 = r14908908 - r14908909;
double r14908911 = r14908905 ? r14908910 : r14908896;
double r14908912 = r14908898 ? r14908903 : r14908911;
double r14908913 = r14908872 ? r14908896 : r14908912;
return r14908913;
}
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \le -1650.055784837749:\\
\;\;\;\;\left(e^{\log \left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} + {\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \left((\left(\frac{\frac{\frac{1}{4}}{n}}{n}\right) \cdot \left(\frac{\log x}{x}\right) + \left(\frac{\frac{1}{2}}{x \cdot n}\right))_* - \frac{\frac{\frac{1}{4}}{n}}{x \cdot x}\right)\\
\mathbf{elif}\;n \le 9.8058607172592 \cdot 10^{-311}:\\
\;\;\;\;\left(e^{\log \left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} + {\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \sqrt[3]{\left(\left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - e^{\log \left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)}\right) \cdot \left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - e^{\log \left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)}\right)\right) \cdot \left({\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)} - e^{\log \left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)}\right)}\\
\mathbf{elif}\;n \le 271.3240147216949:\\
\;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(e^{\log \left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} + {\left(x + 1\right)}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \left((\left(\frac{\frac{\frac{1}{4}}{n}}{n}\right) \cdot \left(\frac{\log x}{x}\right) + \left(\frac{\frac{1}{2}}{x \cdot n}\right))_* - \frac{\frac{\frac{1}{4}}{n}}{x \cdot x}\right)\\
\end{array}


Bits error versus x



Bits error versus n
if n < -1650.055784837749 or 271.3240147216949 < n Initial program 44.6
rmApplied add-exp-log44.6
rmApplied sqr-pow44.7
Applied log-prod44.7
Applied exp-sum44.7
Applied sqr-pow44.7
Applied difference-of-squares44.7
Taylor expanded around inf 32.4
Simplified32.4
if -1650.055784837749 < n < 9.8058607172592e-311Initial program 0.2
rmApplied add-exp-log0.2
rmApplied sqr-pow0.2
Applied log-prod0.2
Applied exp-sum0.2
Applied sqr-pow0.2
Applied difference-of-squares0.2
rmApplied add-cbrt-cube0.2
if 9.8058607172592e-311 < n < 271.3240147216949Initial program 25.1
rmApplied add-exp-log25.1
Applied pow-exp25.1
Simplified0.5
Final simplification18.9
herbie shell --seed 2019102 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))