\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;1 - x1 \le 0.99059549999999996:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{x0}{1 - x1}}, \sqrt{\frac{x0}{1 - x1}}, -x0\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({e}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)}\right)}\\
\end{array}double f(double x0, double x1) {
double r158528 = x0;
double r158529 = 1.0;
double r158530 = x1;
double r158531 = r158529 - r158530;
double r158532 = r158528 / r158531;
double r158533 = r158532 - r158528;
return r158533;
}
double f(double x0, double x1) {
double r158534 = 1.0;
double r158535 = x1;
double r158536 = r158534 - r158535;
double r158537 = 0.9905955;
bool r158538 = r158536 <= r158537;
double r158539 = x0;
double r158540 = r158539 / r158536;
double r158541 = sqrt(r158540);
double r158542 = -r158539;
double r158543 = fma(r158541, r158541, r158542);
double r158544 = exp(1.0);
double r158545 = cbrt(r158539);
double r158546 = r158545 * r158545;
double r158547 = 1.0;
double r158548 = r158546 / r158547;
double r158549 = r158545 / r158536;
double r158550 = fma(r158548, r158549, r158542);
double r158551 = log(r158550);
double r158552 = cbrt(r158551);
double r158553 = r158552 * r158552;
double r158554 = pow(r158544, r158553);
double r158555 = pow(r158554, r158552);
double r158556 = r158538 ? r158543 : r158555;
return r158556;
}




Bits error versus x0




Bits error versus x1
| Original | 8.4 |
|---|---|
| Target | 0.5 |
| Herbie | 5.6 |
if (- 1.0 x1) < 0.9905955Initial program 5.5
rmApplied add-sqr-sqrt4.4
Applied fma-neg3.2
if 0.9905955 < (- 1.0 x1) Initial program 11.3
rmApplied *-un-lft-identity11.3
Applied add-cube-cbrt11.3
Applied times-frac10.7
Applied fma-neg8.1
rmApplied add-exp-log8.1
rmApplied pow18.1
Applied log-pow8.1
Applied exp-prod8.1
Simplified8.1
rmApplied add-cube-cbrt8.1
Applied pow-unpow8.0
Final simplification5.6
herbie shell --seed 2020065 +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))