\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x1 \le 2.12089080810546861 \cdot 10^{-4}:\\
\;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt[3]{x0}}{\sqrt{1 - x1}}\right) - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\
\end{array}double code(double x0, double x1) {
return ((x0 / (1.0 - x1)) - x0);
}
double code(double x0, double x1) {
double temp;
if ((x1 <= 0.00021208908081054686)) {
temp = (log(exp((((x0 / (1.0 - x1)) * (((cbrt(x0) * cbrt(x0)) / sqrt((1.0 - x1))) * (cbrt(x0) / sqrt((1.0 - x1))))) - (x0 * x0)))) / ((x0 / (1.0 - x1)) + x0));
} else {
temp = (log(exp((((x0 / (1.0 - x1)) * (x0 / (1.0 - x1))) - (x0 * x0)))) / ((x0 / (1.0 - x1)) + x0));
}
return temp;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 4.7 |
if x1 < 0.00021208908081054686Initial program 11.2
rmApplied flip--11.4
rmApplied add-sqr-sqrt8.0
Applied add-cube-cbrt8.0
Applied times-frac8.0
rmApplied add-log-exp8.0
Applied add-log-exp8.0
Applied diff-log7.4
Simplified7.4
if 0.00021208908081054686 < x1 Initial program 4.5
rmApplied flip--3.1
rmApplied add-log-exp3.1
Applied add-log-exp3.1
Applied diff-log3.5
Simplified1.9
Final simplification4.7
herbie shell --seed 2020060
(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))