\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 ((double) ((x0 / ((double) (1.0 - x1))) - x0));
}
double code(double x0, double x1) {
double tmp;
if ((x1 <= 0.00021208908081054686)) {
tmp = (((double) (x0 * ((double) (((double) log(((double) cbrt(((double) exp(((double) ((x0 / ((double) (1.0 + ((double) (x1 * ((double) (x1 - 2.0))))))) - x0)))))))) + ((double) (((double) log(((double) cbrt(((double) exp(((double) ((x0 / ((double) (1.0 + ((double) (x1 * ((double) (x1 - 2.0))))))) - x0)))))))) * 2.0)))))) / ((double) (x0 + (x0 / ((double) (1.0 - x1))))));
} else {
tmp = (((double) (x0 * ((double) log(((double) exp(((double) ((x0 / ((double) (1.0 + ((double) (x1 * ((double) (x1 - 2.0))))))) - x0)))))))) / ((double) (x0 + (1.0 / (((double) (1.0 - x1)) / x0)))));
}
return tmp;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 8.3 |
|---|---|
| Target | 0.5 |
| Herbie | 3.3 |
if x1 < 2.12089080810546861e-4Initial program Error: 11.3 bits
rmApplied flip--Error: 11.4 bits
SimplifiedError: 9.1 bits
SimplifiedError: 9.1 bits
Taylor expanded around 0 Error: 11.3 bits
SimplifiedError: 9.1 bits
rmApplied add-log-expError: 9.1 bits
Applied add-log-expError: 9.1 bits
Applied diff-logError: 8.9 bits
SimplifiedError: 8.9 bits
rmApplied add-cube-cbrtError: 10.6 bits
Applied log-prodError: 9.9 bits
SimplifiedError: 6.6 bits
if 2.12089080810546861e-4 < x1 Initial program Error: 5.5 bits
rmApplied flip--Error: 4.0 bits
SimplifiedError: 4.7 bits
SimplifiedError: 4.7 bits
Taylor expanded around 0 Error: 2.8 bits
SimplifiedError: 2.8 bits
rmApplied add-log-expError: 2.8 bits
Applied add-log-expError: 2.8 bits
Applied diff-logError: 3.9 bits
SimplifiedError: 1.0 bits
rmApplied clear-numError: 0 bits
Final simplificationError: 3.3 bits
herbie shell --seed 2020204
(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))