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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.4 |
|---|---|
| Target | 2.2 |
| Herbie | 2.0 |
if x < -1.19602172293634039e-83 or 1.02095349206131194e-244 < x Initial program 6.9
rmApplied clear-num_binary64_116716.9
Simplified6.9
rmApplied *-un-lft-identity_binary64_116726.9
Applied times-frac_binary64_116781.0
Applied associate-/r*_binary64_116161.0
Simplified1.0
if -1.19602172293634039e-83 < x < 1.02095349206131194e-244Initial program 4.9
rmApplied clear-num_binary64_116715.0
Simplified5.0
Final simplification2.0
herbie shell --seed 2021043
(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)))