\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 r186231 = x0;
double r186232 = 1.0;
double r186233 = x1;
double r186234 = r186232 - r186233;
double r186235 = r186231 / r186234;
double r186236 = r186235 - r186231;
return r186236;
}
double f(double x0, double x1) {
double r186237 = 1.0;
double r186238 = x0;
double r186239 = exp(r186238);
double r186240 = sqrt(r186239);
double r186241 = r186237 / r186240;
double r186242 = log(r186241);
double r186243 = 3.0;
double r186244 = pow(r186242, r186243);
double r186245 = cbrt(r186238);
double r186246 = 1.0;
double r186247 = x1;
double r186248 = r186246 - r186247;
double r186249 = r186245 / r186248;
double r186250 = 0.6666666666666666;
double r186251 = pow(r186238, r186250);
double r186252 = fma(r186249, r186251, r186242);
double r186253 = pow(r186252, r186243);
double r186254 = r186244 + r186253;
double r186255 = r186249 * r186251;
double r186256 = r186252 * r186255;
double r186257 = log(r186240);
double r186258 = r186257 * r186257;
double r186259 = r186256 + r186258;
double r186260 = r186254 / r186259;
return r186260;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 5.4 |
Initial program 7.9
rmApplied *-un-lft-identity7.9
Applied add-cube-cbrt7.9
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-frac6.9
Applied log-prod7.0
Simplified7.0
Simplified6.4
rmApplied flip3-+5.5
Simplified5.4
Final simplification5.4
herbie shell --seed 2020036 +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))