x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \le -1.93771321468104164 \cdot 10^{-120} \lor \neg \left(x \le -2.3612955667005291 \cdot 10^{-303}\right):\\
\;\;\;\;x + \frac{z - x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(z - x\right)\right) \cdot \frac{1}{t}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((x <= -1.9377132146810416e-120) || !(x <= -2.361295566700529e-303))) {
VAR = ((double) (x + ((double) (((double) (z - x)) / ((double) (t / y))))));
} else {
VAR = ((double) (x + ((double) (((double) (y * ((double) (z - x)))) * ((double) (1.0 / t))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.1 |
|---|---|
| Target | 2.0 |
| Herbie | 2.0 |
if x < -1.93771321468104164e-120 or -2.3612955667005291e-303 < x Initial program 6.4
rmApplied clear-num6.4
rmApplied associate-/r*1.5
Taylor expanded around 0 6.4
Simplified1.4
if -1.93771321468104164e-120 < x < -2.3612955667005291e-303Initial program 4.9
rmApplied div-inv5.0
Final simplification2.0
herbie shell --seed 2020162
(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)) (* (neg z) (/ y t))))
(+ x (/ (* y (- z x)) t)))