\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 1.874921874999999849009668650978710502386:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right) + \left(\left(-x0\right) + x0\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\mathsf{fma}\left(\frac{{x0}^{\frac{2}{3}}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt[3]{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\right)}^{3}} + \left(\left(-x0\right) + x0\right)\\
\end{array}double f(double x0, double x1) {
double r190777 = x0;
double r190778 = 1.0;
double r190779 = x1;
double r190780 = r190778 - r190779;
double r190781 = r190777 / r190780;
double r190782 = r190781 - r190777;
return r190782;
}
double f(double x0, double x1) {
double r190783 = x0;
double r190784 = 1.8749218749999998;
bool r190785 = r190783 <= r190784;
double r190786 = sqrt(r190783);
double r190787 = 1.0;
double r190788 = sqrt(r190787);
double r190789 = x1;
double r190790 = sqrt(r190789);
double r190791 = r190788 + r190790;
double r190792 = r190786 / r190791;
double r190793 = r190788 - r190790;
double r190794 = r190786 / r190793;
double r190795 = -r190783;
double r190796 = fma(r190792, r190794, r190795);
double r190797 = r190795 + r190783;
double r190798 = r190796 + r190797;
double r190799 = 0.6666666666666666;
double r190800 = pow(r190783, r190799);
double r190801 = r190800 / r190791;
double r190802 = cbrt(r190783);
double r190803 = r190802 / r190793;
double r190804 = fma(r190801, r190803, r190795);
double r190805 = 3.0;
double r190806 = pow(r190804, r190805);
double r190807 = cbrt(r190806);
double r190808 = r190807 + r190797;
double r190809 = r190785 ? r190798 : r190808;
return r190809;
}




Bits error versus x0




Bits error versus x1
| Original | 7.8 |
|---|---|
| Target | 0.3 |
| Herbie | 6.1 |
if x0 < 1.8749218749999998Initial program 7.4
rmApplied add-sqr-sqrt7.4
Applied add-sqr-sqrt7.4
Applied add-sqr-sqrt7.4
Applied difference-of-squares7.4
Applied add-sqr-sqrt7.4
Applied times-frac7.4
Applied prod-diff7.5
Simplified7.5
Simplified5.3
if 1.8749218749999998 < x0 Initial program 8.3
rmApplied add-sqr-sqrt8.3
Applied add-sqr-sqrt8.3
Applied add-sqr-sqrt8.3
Applied difference-of-squares8.3
Applied add-cube-cbrt8.3
Applied times-frac8.2
Applied prod-diff7.2
Simplified7.2
Simplified6.9
rmApplied add-cbrt-cube7.0
Simplified7.0
Final simplification6.1
herbie shell --seed 2019209 +o rules:numerics
(FPCore (x0 x1)
:name "(- (/ x0 (- 1 x1)) x0)"
:precision binary64
:pre (or (and (== x0 1.855) (== x1 2.09000000000000012e-4)) (and (== x0 2.98499999999999988) (== x1 0.018599999999999998)))
:herbie-target
(/ (* x0 x1) (- 1 x1))
(- (/ x0 (- 1 x1)) x0))