\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 r132885 = x0;
double r132886 = 1.0;
double r132887 = x1;
double r132888 = r132886 - r132887;
double r132889 = r132885 / r132888;
double r132890 = r132889 - r132885;
return r132890;
}
double f(double x0, double x1) {
double r132891 = 1.0;
double r132892 = x0;
double r132893 = exp(r132892);
double r132894 = sqrt(r132893);
double r132895 = r132891 / r132894;
double r132896 = log(r132895);
double r132897 = 3.0;
double r132898 = pow(r132896, r132897);
double r132899 = cbrt(r132892);
double r132900 = 1.0;
double r132901 = x1;
double r132902 = r132900 - r132901;
double r132903 = r132899 / r132902;
double r132904 = 0.6666666666666666;
double r132905 = pow(r132892, r132904);
double r132906 = fma(r132903, r132905, r132896);
double r132907 = pow(r132906, r132897);
double r132908 = r132898 + r132907;
double r132909 = r132903 * r132905;
double r132910 = r132906 * r132909;
double r132911 = log(r132894);
double r132912 = r132911 * r132911;
double r132913 = r132910 + r132912;
double r132914 = r132908 / r132913;
return r132914;
}




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