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




Bits error versus x0




Bits error versus x1
Results
| Original | 8.4 |
|---|---|
| Target | 0.5 |
| Herbie | 3.4 |
if x1 < 2.12089080810546861e-4Initial program 11.3
rmApplied flip--_binary6411.4
Simplified9.1
Simplified9.1
Taylor expanded around 0 11.3
Simplified9.1
rmApplied add-log-exp_binary649.1
Applied add-log-exp_binary649.1
Applied diff-log_binary648.9
Simplified8.9
rmApplied add-cube-cbrt_binary6410.6
Applied log-prod_binary649.9
Simplified6.6
if 2.12089080810546861e-4 < x1 Initial program 5.5
rmApplied flip--_binary644.0
Simplified4.7
Simplified4.7
Taylor expanded around 0 2.8
Simplified2.8
rmApplied add-log-exp_binary642.8
Applied add-log-exp_binary642.8
Applied diff-log_binary643.9
Simplified1.0
rmApplied clear-num_binary640
Final simplification3.4
herbie shell --seed 2020232
(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))