\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 code(double x0, double x1) {
return ((x0 / (1.0 - x1)) - x0);
}
double code(double x0, double x1) {
double VAR;
if (((1.0 - x1) <= 0.9905955)) {
VAR = fma(sqrt((x0 / (1.0 - x1))), sqrt((x0 / (1.0 - x1))), -x0);
} else {
VAR = pow(pow(((double) M_E), (cbrt(log(fma(((cbrt(x0) * cbrt(x0)) / 1.0), (cbrt(x0) / (1.0 - x1)), -x0))) * cbrt(log(fma(((cbrt(x0) * cbrt(x0)) / 1.0), (cbrt(x0) / (1.0 - x1)), -x0))))), cbrt(log(fma(((cbrt(x0) * cbrt(x0)) / 1.0), (cbrt(x0) / (1.0 - x1)), -x0))));
}
return VAR;
}




Bits error versus x0




Bits error versus x1
Results
| 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 2020078 +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))