\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 r164011 = x0;
double r164012 = 1.0;
double r164013 = x1;
double r164014 = r164012 - r164013;
double r164015 = r164011 / r164014;
double r164016 = r164015 - r164011;
return r164016;
}
double f(double x0, double x1) {
double r164017 = 1.0;
double r164018 = x0;
double r164019 = exp(r164018);
double r164020 = sqrt(r164019);
double r164021 = r164017 / r164020;
double r164022 = log(r164021);
double r164023 = 3.0;
double r164024 = pow(r164022, r164023);
double r164025 = cbrt(r164018);
double r164026 = 1.0;
double r164027 = x1;
double r164028 = r164026 - r164027;
double r164029 = r164025 / r164028;
double r164030 = 0.6666666666666666;
double r164031 = pow(r164018, r164030);
double r164032 = fma(r164029, r164031, r164022);
double r164033 = pow(r164032, r164023);
double r164034 = r164024 + r164033;
double r164035 = r164029 * r164031;
double r164036 = r164032 * r164035;
double r164037 = log(r164020);
double r164038 = r164037 * r164037;
double r164039 = r164036 + r164038;
double r164040 = r164034 / r164039;
return r164040;
}




Bits error versus x0




Bits error versus x1
| Original | 7.8 |
|---|---|
| Target | 0.2 |
| Herbie | 5.5 |
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.9
rmApplied add-sqr-sqrt7.3
Applied *-un-lft-identity7.3
Applied unpow-prod-down7.3
Applied times-frac7.0
Applied log-prod7.0
Simplified7.0
Simplified6.4
rmApplied flip3-+5.5
Simplified5.5
Final simplification5.5
herbie shell --seed 2020024 +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))