x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \leq -8.815637691747206 \cdot 10^{-87} \lor \neg \left(x \leq 3.5767859404124596 \cdot 10^{-131}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t) :precision binary64 (if (or (<= x -8.815637691747206e-87) (not (<= x 3.5767859404124596e-131))) (+ x (* (/ y t) (- z x))) (+ x (/ y (/ t (- z x))))))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.815637691747206e-87) || !(x <= 3.5767859404124596e-131)) {
tmp = x + ((y / t) * (z - x));
} else {
tmp = x + (y / (t / (z - x)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 1.9 |
| Herbie | 1.9 |
if x < -8.81575e-87 or 3.57679e-131 < x Initial program 7.7
rmApplied associate-/l*_binary64_44906.0
rmApplied associate-/r/_binary64_44910.5
if -8.81575e-87 < x < 3.57679e-131Initial program 5.2
rmApplied associate-/l*_binary64_44904.5
Final simplification1.9
herbie shell --seed 2020231
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))