\frac{x0}{1 - x1} - x0\frac{{\left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)}^{3} + {\left(\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}^{3}}{\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1} \cdot {x0}^{\frac{2}{3}}\right) + \log \left(\sqrt{e^{x0}}\right) \cdot \log \left(\sqrt{e^{x0}}\right)}double f(double x0, double x1) {
double r189548 = x0;
double r189549 = 1.0;
double r189550 = x1;
double r189551 = r189549 - r189550;
double r189552 = r189548 / r189551;
double r189553 = r189552 - r189548;
return r189553;
}
double f(double x0, double x1) {
double r189554 = 1.0;
double r189555 = x0;
double r189556 = exp(r189555);
double r189557 = sqrt(r189556);
double r189558 = r189554 / r189557;
double r189559 = log(r189558);
double r189560 = 3.0;
double r189561 = pow(r189559, r189560);
double r189562 = cbrt(r189555);
double r189563 = 1.0;
double r189564 = x1;
double r189565 = r189563 - r189564;
double r189566 = r189562 / r189565;
double r189567 = 0.6666666666666666;
double r189568 = pow(r189555, r189567);
double r189569 = fma(r189566, r189568, r189559);
double r189570 = pow(r189569, r189560);
double r189571 = r189561 + r189570;
double r189572 = r189566 * r189568;
double r189573 = r189569 * r189572;
double r189574 = log(r189557);
double r189575 = r189574 * r189574;
double r189576 = r189573 + r189575;
double r189577 = r189571 / r189576;
return r189577;
}




Bits error versus x0




Bits error versus x1
| Original | 7.8 |
|---|---|
| Target | 0.3 |
| Herbie | 5.4 |
Initial program 7.8
rmApplied *-un-lft-identity7.8
Applied add-cube-cbrt7.8
Applied times-frac8.2
Applied fma-neg6.9
rmApplied add-log-exp7.8
Simplified6.8
rmApplied add-sqr-sqrt7.3
Applied *-un-lft-identity7.3
Applied unpow-prod-down7.3
Applied times-frac6.9
Applied log-prod7.0
Simplified7.0
Simplified6.4
rmApplied flip3-+5.5
Simplified5.4
Final simplification5.4
herbie shell --seed 2020003 +o rules:numerics
(FPCore (x0 x1)
:name "(- (/ x0 (- 1 x1)) x0)"
:precision binary64
:pre (or (and (== x0 1.855) (== x1 0.000209)) (and (== x0 2.985) (== x1 0.0186)))
:herbie-target
(/ (* x0 x1) (- 1 x1))
(- (/ x0 (- 1 x1)) x0))