\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 1.87492187499999985:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt[3]{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\end{array}double f(double x0, double x1) {
double r344603 = x0;
double r344604 = 1.0;
double r344605 = x1;
double r344606 = r344604 - r344605;
double r344607 = r344603 / r344606;
double r344608 = r344607 - r344603;
return r344608;
}
double f(double x0, double x1) {
double r344609 = x0;
double r344610 = 1.8749218749999998;
bool r344611 = r344609 <= r344610;
double r344612 = sqrt(r344609);
double r344613 = 1.0;
double r344614 = sqrt(r344613);
double r344615 = x1;
double r344616 = sqrt(r344615);
double r344617 = r344614 + r344616;
double r344618 = r344612 / r344617;
double r344619 = r344614 - r344616;
double r344620 = r344612 / r344619;
double r344621 = -r344609;
double r344622 = fma(r344618, r344620, r344621);
double r344623 = cbrt(r344609);
double r344624 = r344623 * r344623;
double r344625 = r344624 / r344617;
double r344626 = r344623 / r344619;
double r344627 = fma(r344625, r344626, r344621);
double r344628 = r344611 ? r344622 : r344627;
return r344628;
}




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 difference-of-squares7.4
Applied add-sqr-sqrt7.4
Applied times-frac7.4
Applied fma-neg5.3
if 1.8749218749999998 < x0 Initial program 8.3
rmApplied add-sqr-sqrt8.3
Applied add-sqr-sqrt8.3
Applied difference-of-squares8.3
Applied add-cube-cbrt8.3
Applied times-frac8.1
Applied fma-neg6.9
Final simplification6.1
herbie shell --seed 2020045 +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))