\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 r528 = x0;
double r529 = 1.0;
double r530 = x1;
double r531 = r529 - r530;
double r532 = r528 / r531;
double r533 = r532 - r528;
return r533;
}
double f(double x0, double x1) {
double r534 = 1.0;
double r535 = x0;
double r536 = exp(r535);
double r537 = sqrt(r536);
double r538 = r534 / r537;
double r539 = log(r538);
double r540 = 3.0;
double r541 = pow(r539, r540);
double r542 = cbrt(r535);
double r543 = 1.0;
double r544 = x1;
double r545 = r543 - r544;
double r546 = r542 / r545;
double r547 = 0.6666666666666666;
double r548 = pow(r535, r547);
double r549 = fma(r546, r548, r539);
double r550 = pow(r549, r540);
double r551 = r541 + r550;
double r552 = r546 * r548;
double r553 = r549 * r552;
double r554 = log(r537);
double r555 = r554 * r554;
double r556 = r553 + r555;
double r557 = r551 / r556;
return r557;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.3 |
| 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 2020025 +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))