\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 r148108 = x0;
double r148109 = 1.0;
double r148110 = x1;
double r148111 = r148109 - r148110;
double r148112 = r148108 / r148111;
double r148113 = r148112 - r148108;
return r148113;
}
double f(double x0, double x1) {
double r148114 = 1.0;
double r148115 = x0;
double r148116 = exp(r148115);
double r148117 = sqrt(r148116);
double r148118 = r148114 / r148117;
double r148119 = log(r148118);
double r148120 = 3.0;
double r148121 = pow(r148119, r148120);
double r148122 = cbrt(r148115);
double r148123 = 1.0;
double r148124 = x1;
double r148125 = r148123 - r148124;
double r148126 = r148122 / r148125;
double r148127 = 0.6666666666666666;
double r148128 = pow(r148115, r148127);
double r148129 = fma(r148126, r148128, r148119);
double r148130 = pow(r148129, r148120);
double r148131 = r148121 + r148130;
double r148132 = r148126 * r148128;
double r148133 = r148129 * r148132;
double r148134 = log(r148117);
double r148135 = r148134 * r148134;
double r148136 = r148133 + r148135;
double r148137 = r148131 / r148136;
return r148137;
}




Bits error versus x0




Bits error versus x1
| Original | 7.8 |
|---|---|
| Target | 0.2 |
| 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.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 2020056 +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))