{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \le -3.858253988214169272711275460348290256007 \cdot 10^{-8}:\\
\;\;\;\;\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \log \left(e^{\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt[3]{\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} + {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right) \cdot \left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - {x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)}}\right)\\
\mathbf{elif}\;\frac{1}{n} \le 1.863364080616155825796168983867868088999 \cdot 10^{-31}:\\
\;\;\;\;\left(\frac{1}{x \cdot n} - \frac{0.5}{n \cdot \left(x \cdot x\right)}\right) + \frac{\log x \cdot 1}{x \cdot \left(n \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(\sqrt{e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}}}\right) + \log \left(\sqrt{e^{-{x}^{\left(\frac{1}{n}\right)}}}\right)\right) + \log \left(\sqrt{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 r11104652 = x;
double r11104653 = 1.0;
double r11104654 = r11104652 + r11104653;
double r11104655 = n;
double r11104656 = r11104653 / r11104655;
double r11104657 = pow(r11104654, r11104656);
double r11104658 = pow(r11104652, r11104656);
double r11104659 = r11104657 - r11104658;
return r11104659;
}
double f(double x, double n) {
double r11104660 = 1.0;
double r11104661 = n;
double r11104662 = r11104660 / r11104661;
double r11104663 = -3.858253988214169e-08;
bool r11104664 = r11104662 <= r11104663;
double r11104665 = x;
double r11104666 = r11104665 + r11104660;
double r11104667 = pow(r11104666, r11104662);
double r11104668 = pow(r11104665, r11104662);
double r11104669 = r11104667 - r11104668;
double r11104670 = cbrt(r11104669);
double r11104671 = sqrt(r11104667);
double r11104672 = 2.0;
double r11104673 = r11104662 / r11104672;
double r11104674 = pow(r11104665, r11104673);
double r11104675 = r11104671 + r11104674;
double r11104676 = r11104671 - r11104674;
double r11104677 = r11104675 * r11104676;
double r11104678 = cbrt(r11104677);
double r11104679 = r11104670 * r11104678;
double r11104680 = exp(r11104679);
double r11104681 = log(r11104680);
double r11104682 = r11104670 * r11104681;
double r11104683 = 1.8633640806161558e-31;
bool r11104684 = r11104662 <= r11104683;
double r11104685 = r11104665 * r11104661;
double r11104686 = r11104660 / r11104685;
double r11104687 = 0.5;
double r11104688 = r11104665 * r11104665;
double r11104689 = r11104661 * r11104688;
double r11104690 = r11104687 / r11104689;
double r11104691 = r11104686 - r11104690;
double r11104692 = log(r11104665);
double r11104693 = r11104692 * r11104660;
double r11104694 = r11104661 * r11104661;
double r11104695 = r11104665 * r11104694;
double r11104696 = r11104693 / r11104695;
double r11104697 = r11104691 + r11104696;
double r11104698 = exp(r11104667);
double r11104699 = sqrt(r11104698);
double r11104700 = log(r11104699);
double r11104701 = -r11104668;
double r11104702 = exp(r11104701);
double r11104703 = sqrt(r11104702);
double r11104704 = log(r11104703);
double r11104705 = r11104700 + r11104704;
double r11104706 = exp(r11104669);
double r11104707 = sqrt(r11104706);
double r11104708 = log(r11104707);
double r11104709 = r11104705 + r11104708;
double r11104710 = r11104684 ? r11104697 : r11104709;
double r11104711 = r11104664 ? r11104682 : r11104710;
return r11104711;
}



Bits error versus x



Bits error versus n
Results
if (/ 1.0 n) < -3.858253988214169e-08Initial program 0.9
rmApplied add-log-exp1.3
Applied add-log-exp1.1
Applied diff-log1.1
Simplified1.1
rmApplied add-cube-cbrt1.1
Applied exp-prod1.1
Applied log-pow1.1
rmApplied sqr-pow1.1
Applied add-sqr-sqrt1.1
Applied difference-of-squares1.1
if -3.858253988214169e-08 < (/ 1.0 n) < 1.8633640806161558e-31Initial program 44.4
Taylor expanded around inf 31.9
Simplified31.9
if 1.8633640806161558e-31 < (/ 1.0 n) Initial program 28.5
rmApplied add-log-exp28.6
Applied add-log-exp28.6
Applied diff-log28.7
Simplified28.6
rmApplied add-sqr-sqrt28.7
Applied log-prod28.7
rmApplied sub-neg28.7
Applied exp-sum28.7
Applied sqrt-prod28.7
Applied log-prod28.7
Final simplification22.2
herbie shell --seed 2019173
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))