\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x1 \le 2.78888122558593676 \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)}{x0 \cdot x0 + \frac{x0}{1 - x1} \cdot \left(\frac{x0}{1 - x1} + \frac{x0}{{\left(1 - x1\right)}^{3}}\right)}}{\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)}{x0 \cdot x0 + \frac{x0}{1 - x1} \cdot \left(\frac{x0}{1 - x1} + \frac{x0}{{\left(1 - x1\right)}^{3}}\right)}}{\frac{x0}{1 - x1} + x0}\\
\end{array}double f(double x0, double x1) {
double r161705 = x0;
double r161706 = 1.0;
double r161707 = x1;
double r161708 = r161706 - r161707;
double r161709 = r161705 / r161708;
double r161710 = r161709 - r161705;
return r161710;
}
double f(double x0, double x1) {
double r161711 = x1;
double r161712 = 0.0002788881225585937;
bool r161713 = r161711 <= r161712;
double r161714 = x0;
double r161715 = 3.0;
double r161716 = pow(r161714, r161715);
double r161717 = 1.0;
double r161718 = r161717 - r161711;
double r161719 = 6.0;
double r161720 = pow(r161718, r161719);
double r161721 = r161716 / r161720;
double r161722 = r161721 - r161716;
double r161723 = exp(r161722);
double r161724 = sqrt(r161723);
double r161725 = log(r161724);
double r161726 = r161725 + r161725;
double r161727 = r161714 * r161714;
double r161728 = r161714 / r161718;
double r161729 = pow(r161718, r161715);
double r161730 = r161714 / r161729;
double r161731 = r161728 + r161730;
double r161732 = r161728 * r161731;
double r161733 = r161727 + r161732;
double r161734 = r161726 / r161733;
double r161735 = r161714 * r161734;
double r161736 = r161728 + r161714;
double r161737 = r161735 / r161736;
double r161738 = sqrt(r161717);
double r161739 = sqrt(r161711);
double r161740 = r161738 + r161739;
double r161741 = pow(r161740, r161719);
double r161742 = r161738 - r161739;
double r161743 = pow(r161742, r161719);
double r161744 = r161741 * r161743;
double r161745 = r161716 / r161744;
double r161746 = r161745 - r161716;
double r161747 = exp(r161746);
double r161748 = log(r161747);
double r161749 = r161748 / r161733;
double r161750 = r161714 * r161749;
double r161751 = r161750 / r161736;
double r161752 = r161713 ? r161737 : r161751;
return r161752;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 8.0 |
|---|---|
| Target | 0.2 |
| Herbie | 2.4 |
if x1 < 0.0002788881225585937Initial program 11.2
rmApplied flip--11.4
Simplified8.7
rmApplied flip3--5.9
Simplified5.8
rmApplied add-log-exp5.8
Applied add-log-exp5.8
Applied diff-log5.0
Simplified5.0
rmApplied add-sqr-sqrt3.3
Applied log-prod2.9
if 0.0002788881225585937 < 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 2020043
(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))