\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 r134673 = x0;
double r134674 = 1.0;
double r134675 = x1;
double r134676 = r134674 - r134675;
double r134677 = r134673 / r134676;
double r134678 = r134677 - r134673;
return r134678;
}
double f(double x0, double x1) {
double r134679 = 1.0;
double r134680 = x0;
double r134681 = exp(r134680);
double r134682 = sqrt(r134681);
double r134683 = r134679 / r134682;
double r134684 = log(r134683);
double r134685 = 3.0;
double r134686 = pow(r134684, r134685);
double r134687 = cbrt(r134680);
double r134688 = 1.0;
double r134689 = x1;
double r134690 = r134688 - r134689;
double r134691 = r134687 / r134690;
double r134692 = 0.6666666666666666;
double r134693 = pow(r134680, r134692);
double r134694 = fma(r134691, r134693, r134684);
double r134695 = pow(r134694, r134685);
double r134696 = r134686 + r134695;
double r134697 = r134691 * r134693;
double r134698 = r134694 * r134697;
double r134699 = log(r134682);
double r134700 = r134699 * r134699;
double r134701 = r134698 + r134700;
double r134702 = r134696 / r134701;
return r134702;
}




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