\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x1 \le 2.12089080810546861 \cdot 10^{-4}:\\
\;\;\;\;\frac{x0 \cdot \frac{\log \left(\sqrt{e^{\frac{{x0}^{3}}{{\left(1 - x1\right)}^{6}} - {x0}^{3}}}\right) + \log \left(\sqrt{e^{\frac{{x0}^{3}}{{\left(1 - x1\right)}^{6}} - {x0}^{3}}}\right)}{\frac{x0}{1 - x1} \cdot \left(\frac{x0}{1 - x1} + \frac{x0}{{\left(1 - x1\right)}^{3}}\right) + x0 \cdot x0}}{\frac{x0}{1 - x1} + x0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x0 \cdot \frac{\log \left(e^{\frac{{x0}^{3}}{{\left(\sqrt{1} + \sqrt{x1}\right)}^{6} \cdot {\left(\sqrt{1} - \sqrt{x1}\right)}^{6}} - {x0}^{3}}\right)}{\frac{x0}{1 - x1} \cdot \left(\frac{x0}{1 - x1} + \frac{x0}{{\left(1 - x1\right)}^{3}}\right) + x0 \cdot x0}}{\frac{x0}{1 - x1} + x0}\\
\end{array}double f(double x0, double x1) {
double r161464 = x0;
double r161465 = 1.0;
double r161466 = x1;
double r161467 = r161465 - r161466;
double r161468 = r161464 / r161467;
double r161469 = r161468 - r161464;
return r161469;
}
double f(double x0, double x1) {
double r161470 = x1;
double r161471 = 0.00021208908081054686;
bool r161472 = r161470 <= r161471;
double r161473 = x0;
double r161474 = 3.0;
double r161475 = pow(r161473, r161474);
double r161476 = 1.0;
double r161477 = r161476 - r161470;
double r161478 = 6.0;
double r161479 = pow(r161477, r161478);
double r161480 = r161475 / r161479;
double r161481 = r161480 - r161475;
double r161482 = exp(r161481);
double r161483 = sqrt(r161482);
double r161484 = log(r161483);
double r161485 = r161484 + r161484;
double r161486 = r161473 / r161477;
double r161487 = pow(r161477, r161474);
double r161488 = r161473 / r161487;
double r161489 = r161486 + r161488;
double r161490 = r161486 * r161489;
double r161491 = r161473 * r161473;
double r161492 = r161490 + r161491;
double r161493 = r161485 / r161492;
double r161494 = r161473 * r161493;
double r161495 = r161486 + r161473;
double r161496 = r161494 / r161495;
double r161497 = sqrt(r161476);
double r161498 = sqrt(r161470);
double r161499 = r161497 + r161498;
double r161500 = pow(r161499, r161478);
double r161501 = r161497 - r161498;
double r161502 = pow(r161501, r161478);
double r161503 = r161500 * r161502;
double r161504 = r161475 / r161503;
double r161505 = r161504 - r161475;
double r161506 = exp(r161505);
double r161507 = log(r161506);
double r161508 = r161507 / r161492;
double r161509 = r161473 * r161508;
double r161510 = r161509 / r161495;
double r161511 = r161472 ? r161496 : r161510;
return r161511;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 7.9 |
|---|---|
| Target | 0.3 |
| Herbie | 2.4 |
if x1 < 0.00021208908081054686Initial program 11.2
rmApplied flip--11.4
Simplified8.7
rmApplied flip3--6.0
Simplified5.9
rmApplied add-log-exp5.9
Applied add-log-exp5.9
Applied diff-log5.1
Simplified5.1
rmApplied add-sqr-sqrt3.4
Applied log-prod3.0
if 0.00021208908081054686 < x1 Initial program 4.6
rmApplied flip--3.2
Simplified3.9
rmApplied flip3--3.9
Simplified3.9
rmApplied add-log-exp3.9
Applied add-log-exp3.9
Applied diff-log3.9
Simplified3.8
rmApplied add-sqr-sqrt3.8
Applied add-sqr-sqrt3.8
Applied difference-of-squares3.8
Applied unpow-prod-down1.8
Final simplification2.4
herbie shell --seed 2020046
(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))