\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)}{x0 \cdot x0 + \frac{x0}{1 - x1} \cdot \left(\frac{x0}{{\left(1 - x1\right)}^{3}} + \frac{x0}{1 - x1}\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}{{\left(1 - x1\right)}^{3}} + \frac{x0}{1 - x1}\right)}}{\frac{x0}{1 - x1} + x0}\\
\end{array}double f(double x0, double x1) {
double r183712 = x0;
double r183713 = 1.0;
double r183714 = x1;
double r183715 = r183713 - r183714;
double r183716 = r183712 / r183715;
double r183717 = r183716 - r183712;
return r183717;
}
double f(double x0, double x1) {
double r183718 = x1;
double r183719 = 0.00021208908081054686;
bool r183720 = r183718 <= r183719;
double r183721 = x0;
double r183722 = 3.0;
double r183723 = pow(r183721, r183722);
double r183724 = 1.0;
double r183725 = r183724 - r183718;
double r183726 = 6.0;
double r183727 = pow(r183725, r183726);
double r183728 = r183723 / r183727;
double r183729 = r183728 - r183723;
double r183730 = exp(r183729);
double r183731 = sqrt(r183730);
double r183732 = log(r183731);
double r183733 = r183732 + r183732;
double r183734 = r183721 * r183721;
double r183735 = r183721 / r183725;
double r183736 = pow(r183725, r183722);
double r183737 = r183721 / r183736;
double r183738 = r183737 + r183735;
double r183739 = r183735 * r183738;
double r183740 = r183734 + r183739;
double r183741 = r183733 / r183740;
double r183742 = r183721 * r183741;
double r183743 = r183735 + r183721;
double r183744 = r183742 / r183743;
double r183745 = sqrt(r183724);
double r183746 = sqrt(r183718);
double r183747 = r183745 + r183746;
double r183748 = pow(r183747, r183726);
double r183749 = r183745 - r183746;
double r183750 = pow(r183749, r183726);
double r183751 = r183748 * r183750;
double r183752 = r183723 / r183751;
double r183753 = r183752 - r183723;
double r183754 = exp(r183753);
double r183755 = log(r183754);
double r183756 = r183755 / r183740;
double r183757 = r183721 * r183756;
double r183758 = r183757 / r183743;
double r183759 = r183720 ? r183744 : r183758;
return r183759;
}




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.0
Simplified5.0
rmApplied add-sqr-sqrt3.4
Applied log-prod3.0
if 0.00021208908081054686 < x1 Initial program 4.5
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 2020047
(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))