x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \leq -2.8693177558245846 \cdot 10^{-287} \lor \neg \left(x \leq 3.071303393454297 \cdot 10^{-150}\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 -2.8693177558245846e-287) (not (<= x 3.071303393454297e-150))) (+ 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 <= -2.8693177558245846e-287) || !(x <= 3.071303393454297e-150)) {
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.7 |
|---|---|
| Target | 1.8 |
| Herbie | 1.9 |
if x < -2.86931775582458457e-287 or 3.071303393454297e-150 < x Initial program 6.8
rmApplied associate-/l*_binary64_105946.5
rmApplied associate-/r/_binary64_105951.3
if -2.86931775582458457e-287 < x < 3.071303393454297e-150Initial program 6.1
rmApplied associate-/l*_binary64_105945.0
Final simplification1.9
herbie shell --seed 2020346
(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)))