\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;1 - x1 \le 0.99059549999999996:\\
\;\;\;\;\frac{\log \left(e^{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\frac{x0}{1 - x1} + x0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log \left(e^{\left(\frac{\sqrt{x0}}{\sqrt{1 - x1}} \cdot \frac{\sqrt{x0}}{\sqrt{1 - x1}}\right) \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\right)}{\left(\sqrt[3]{\frac{x0}{1 - x1}} \cdot \sqrt[3]{\frac{x0}{1 - x1}}\right) \cdot \sqrt[3]{\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 (((1.0 - x1) <= 0.9905955)) {
temp = (log(exp((((x0 / (1.0 - x1)) * (x0 / (1.0 - x1))) - (x0 * x0)))) / ((x0 / (1.0 - x1)) + x0));
} else {
temp = (log(exp(((((sqrt(x0) / sqrt((1.0 - x1))) * (sqrt(x0) / sqrt((1.0 - x1)))) * (x0 / (1.0 - x1))) - (x0 * x0)))) / (((cbrt((x0 / (1.0 - x1))) * cbrt((x0 / (1.0 - x1)))) * cbrt((x0 / (1.0 - x1)))) + x0));
}
return temp;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 7.8 |
|---|---|
| Target | 0.2 |
| Herbie | 4.6 |
if (- 1.0 x1) < 0.9905955Initial program 4.5
rmApplied flip--3.2
rmApplied add-log-exp3.2
Applied add-log-exp3.2
Applied diff-log3.5
Simplified1.9
if 0.9905955 < (- 1.0 x1) Initial program 11.2
rmApplied flip--11.4
rmApplied add-sqr-sqrt8.1
Applied add-sqr-sqrt8.1
Applied times-frac8.1
rmApplied add-log-exp8.1
Applied add-log-exp8.1
Applied diff-log7.4
Simplified7.4
rmApplied add-cube-cbrt7.4
Final simplification4.6
herbie shell --seed 2020056
(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))