\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;1 - x1 \leq 0.9905955:\\
\;\;\;\;\frac{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}{\frac{x0 \cdot x0 - \frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1}}{x0 - \frac{1}{\frac{1 - x1}{x0}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x0 \cdot e^{\log \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}}{\frac{\log \left(e^{x0 \cdot x0 - \frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1}}\right)}{x0 - \frac{x0}{1 - x1}}}\\
\end{array}(FPCore (x0 x1) :precision binary64 (- (/ x0 (- 1.0 x1)) x0))
(FPCore (x0 x1)
:precision binary64
(if (<= (- 1.0 x1) 0.9905955)
(/
(* x0 (- (/ x0 (* (- 1.0 x1) (- 1.0 x1))) x0))
(/
(- (* x0 x0) (* (/ x0 (- 1.0 x1)) (/ x0 (- 1.0 x1))))
(- x0 (/ 1.0 (/ (- 1.0 x1) x0)))))
(/
(* x0 (exp (log (- (/ x0 (* (- 1.0 x1) (- 1.0 x1))) x0))))
(/
(log (exp (- (* x0 x0) (* (/ x0 (- 1.0 x1)) (/ x0 (- 1.0 x1))))))
(- x0 (/ x0 (- 1.0 x1)))))))double code(double x0, double x1) {
return (x0 / (1.0 - x1)) - x0;
}
double code(double x0, double x1) {
double tmp;
if ((1.0 - x1) <= 0.9905955) {
tmp = (x0 * ((x0 / ((1.0 - x1) * (1.0 - x1))) - x0)) / (((x0 * x0) - ((x0 / (1.0 - x1)) * (x0 / (1.0 - x1)))) / (x0 - (1.0 / ((1.0 - x1) / x0))));
} else {
tmp = (x0 * exp(log((x0 / ((1.0 - x1) * (1.0 - x1))) - x0))) / (log(exp((x0 * x0) - ((x0 / (1.0 - x1)) * (x0 / (1.0 - x1))))) / (x0 - (x0 / (1.0 - x1))));
}
return tmp;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 8.4 |
|---|---|
| Target | 0.5 |
| Herbie | 3.3 |
if (-.f64 1 x1) < 0.99059549999999996Initial program 5.5
rmApplied flip--_binary644.0
Simplified4.7
Simplified4.7
rmApplied flip-+_binary645.8
rmApplied clear-num_binary643.3
if 0.99059549999999996 < (-.f64 1 x1) Initial program 11.3
rmApplied flip--_binary6411.4
Simplified9.1
Simplified9.1
rmApplied flip-+_binary647.7
rmApplied add-log-exp_binary647.7
Applied add-log-exp_binary647.7
Applied diff-log_binary643.7
Simplified3.7
rmApplied add-exp-log_binary643.3
Final simplification3.3
herbie shell --seed 2020268
(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.0 x1))
(- (/ x0 (- 1.0 x1)) x0))