x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \le -2.414379101552599 \cdot 10^{-259}:\\
\;\;\;\;x + \frac{z - x}{\frac{t}{y}}\\
\mathbf{elif}\;x \le 8.63246856154274614 \cdot 10^{-125}:\\
\;\;\;\;x + \left(y \cdot 1\right) \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{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 <= -2.414379101552599e-259)) {
VAR = ((double) (x + ((double) (((double) (z - x)) / ((double) (t / y))))));
} else {
double VAR_1;
if ((x <= 8.632468561542746e-125)) {
VAR_1 = ((double) (x + ((double) (((double) (y * 1.0)) * ((double) (((double) (z - x)) / t))))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (z - x)) * ((double) (y / t))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 1.9 |
| Herbie | 1.9 |
if x < -2.414379101552599e-259Initial program 6.5
rmApplied *-commutative6.5
Applied associate-/l*1.5
if -2.414379101552599e-259 < x < 8.632468561542746e-125Initial program 5.4
rmApplied div-inv5.4
rmApplied *-un-lft-identity5.4
Applied associate-*r*5.4
Applied associate-*l*4.8
Simplified4.7
if 8.632468561542746e-125 < x Initial program 7.2
rmApplied *-un-lft-identity7.2
Applied *-commutative7.2
Applied times-frac0.6
Simplified0.6
Final simplification1.9
herbie shell --seed 2020114
(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)))