x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \leq 3.4318297806200757 \cdot 10^{-307} \lor \neg \left(x \leq 1.6885056191188459 \cdot 10^{-211}\right):\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t) :precision binary64 (if (or (<= x 3.4318297806200757e-307) (not (<= x 1.6885056191188459e-211))) (+ x (* (- z x) (/ y t))) (+ x (* y (/ (- z x) t)))))
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 <= 3.4318297806200757e-307) || !(x <= 1.6885056191188459e-211)) {
tmp = x + ((z - x) * (y / t));
} else {
tmp = x + (y * ((z - x) / t));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.2 |
|---|---|
| Target | 2.3 |
| Herbie | 2.0 |
if x < 3.4318297806200757e-307 or 1.6885056191188459e-211 < x Initial program 6.2
rmApplied clear-num_binary64_109896.3
Simplified6.3
rmApplied *-un-lft-identity_binary64_109906.3
Applied times-frac_binary64_109961.8
Applied add-sqr-sqrt_binary64_110121.8
Applied times-frac_binary64_109961.9
Simplified1.9
Simplified1.8
if 3.4318297806200757e-307 < x < 1.6885056191188459e-211Initial program 5.4
rmApplied *-un-lft-identity_binary64_109905.4
Applied times-frac_binary64_109964.0
Simplified4.0
Final simplification2.0
herbie shell --seed 2021098
(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)))