\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 r162581 = x0;
double r162582 = 1.0;
double r162583 = x1;
double r162584 = r162582 - r162583;
double r162585 = r162581 / r162584;
double r162586 = r162585 - r162581;
return r162586;
}
double f(double x0, double x1) {
double r162587 = 1.0;
double r162588 = x0;
double r162589 = exp(r162588);
double r162590 = sqrt(r162589);
double r162591 = r162587 / r162590;
double r162592 = log(r162591);
double r162593 = 3.0;
double r162594 = pow(r162592, r162593);
double r162595 = cbrt(r162588);
double r162596 = 1.0;
double r162597 = x1;
double r162598 = r162596 - r162597;
double r162599 = r162595 / r162598;
double r162600 = 0.6666666666666666;
double r162601 = pow(r162588, r162600);
double r162602 = fma(r162599, r162601, r162592);
double r162603 = pow(r162602, r162593);
double r162604 = r162594 + r162603;
double r162605 = r162599 * r162601;
double r162606 = r162602 * r162605;
double r162607 = log(r162590);
double r162608 = r162607 * r162607;
double r162609 = r162606 + r162608;
double r162610 = r162604 / r162609;
return r162610;
}




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 2020062 +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))