{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;n \le -3253307.1591160325:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{2}, \left(\frac{1}{x \cdot \left(x \cdot n\right)}\right), \left(\frac{1}{x \cdot n} - \frac{-\log x}{n \cdot \left(x \cdot n\right)}\right)\right)\\
\mathbf{elif}\;n \le -3.274682954984462 \cdot 10^{-305}:\\
\;\;\;\;\mathsf{log1p}\left(\left(\left(\log \left(\sqrt[3]{e^{\sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)}}} \cdot \sqrt[3]{e^{\sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)}}}\right) + \log \left(\sqrt[3]{e^{\sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)}}}\right)\right) \cdot \sqrt[3]{\mathsf{expm1}\left(\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)\right)}\right)\right)\\
\mathbf{elif}\;n \le 1.3579770284385667 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{2}, \left(\frac{1}{x \cdot \left(x \cdot n\right)}\right), \left(\frac{1}{x \cdot n} - \frac{-\log x}{n \cdot \left(x \cdot n\right)}\right)\right)\\
\end{array}double f(double x, double n) {
double r30905922 = x;
double r30905923 = 1.0;
double r30905924 = r30905922 + r30905923;
double r30905925 = n;
double r30905926 = r30905923 / r30905925;
double r30905927 = pow(r30905924, r30905926);
double r30905928 = pow(r30905922, r30905926);
double r30905929 = r30905927 - r30905928;
return r30905929;
}
double f(double x, double n) {
double r30905930 = n;
double r30905931 = -3253307.1591160325;
bool r30905932 = r30905930 <= r30905931;
double r30905933 = -0.5;
double r30905934 = 1.0;
double r30905935 = x;
double r30905936 = r30905935 * r30905930;
double r30905937 = r30905935 * r30905936;
double r30905938 = r30905934 / r30905937;
double r30905939 = r30905934 / r30905936;
double r30905940 = log(r30905935);
double r30905941 = -r30905940;
double r30905942 = r30905930 * r30905936;
double r30905943 = r30905941 / r30905942;
double r30905944 = r30905939 - r30905943;
double r30905945 = fma(r30905933, r30905938, r30905944);
double r30905946 = -3.274682954984462e-305;
bool r30905947 = r30905930 <= r30905946;
double r30905948 = r30905935 + r30905934;
double r30905949 = r30905934 / r30905930;
double r30905950 = pow(r30905948, r30905949);
double r30905951 = pow(r30905935, r30905949);
double r30905952 = r30905950 - r30905951;
double r30905953 = expm1(r30905952);
double r30905954 = cbrt(r30905953);
double r30905955 = r30905954 * r30905954;
double r30905956 = exp(r30905955);
double r30905957 = cbrt(r30905956);
double r30905958 = r30905957 * r30905957;
double r30905959 = log(r30905958);
double r30905960 = log(r30905957);
double r30905961 = r30905959 + r30905960;
double r30905962 = r30905961 * r30905954;
double r30905963 = log1p(r30905962);
double r30905964 = 1.3579770284385667e+23;
bool r30905965 = r30905930 <= r30905964;
double r30905966 = log1p(r30905935);
double r30905967 = r30905966 / r30905930;
double r30905968 = exp(r30905967);
double r30905969 = r30905968 - r30905951;
double r30905970 = expm1(r30905969);
double r30905971 = log1p(r30905970);
double r30905972 = r30905965 ? r30905971 : r30905945;
double r30905973 = r30905947 ? r30905963 : r30905972;
double r30905974 = r30905932 ? r30905945 : r30905973;
return r30905974;
}



Bits error versus x



Bits error versus n
if n < -3253307.1591160325 or 1.3579770284385667e+23 < n Initial program 44.0
Taylor expanded around inf 31.7
Simplified31.7
if -3253307.1591160325 < n < -3.274682954984462e-305Initial program 0.6
rmApplied log1p-expm1-u0.7
rmApplied add-log-exp0.7
rmApplied add-cube-cbrt0.7
Applied exp-prod0.7
Applied log-pow0.7
rmApplied add-cube-cbrt0.7
Applied log-prod0.7
if -3.274682954984462e-305 < n < 1.3579770284385667e+23Initial program 26.9
rmApplied log1p-expm1-u27.0
rmApplied add-exp-log27.0
Simplified8.2
Final simplification19.4
herbie shell --seed 2019128 +o rules:numerics
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
(- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))