\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 2.9451562499999997:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\log \left(\frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{e^{x0}}\right)\right)}\\
\end{array}double code(double x0, double x1) {
return ((x0 / (1.0 - x1)) - x0);
}
double code(double x0, double x1) {
double temp;
if ((x0 <= 2.9451562499999997)) {
temp = fma((sqrt(x0) / (sqrt(1.0) + sqrt(x1))), (sqrt(x0) / (sqrt(1.0) - sqrt(x1))), -x0);
} else {
temp = exp(log(log((pow(exp(pow(x0, 0.6666666666666666)), (cbrt(x0) / (1.0 - x1))) / exp(x0)))));
}
return temp;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 5.5 |
if x0 < 2.9451562499999997Initial 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 2.9451562499999997 < x0 Initial program 8.4
rmApplied *-un-lft-identity8.4
Applied add-cube-cbrt8.4
Applied times-frac8.4
Applied fma-neg7.2
rmApplied add-exp-log7.2
rmApplied add-log-exp7.6
Simplified5.6
Final simplification5.5
herbie shell --seed 2020060 +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))