x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;y \le -0.0263713862562576194:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\mathbf{elif}\;y \le -3.80871808056728307 \cdot 10^{-307}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{elif}\;y \le 2.7629859023376793 \cdot 10^{166}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{elif}\;y \le 1.41006685399171807 \cdot 10^{272}:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\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 ((y <= -0.02637138625625762)) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
} else {
double VAR_1;
if ((y <= -3.808718080567283e-307)) {
VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
} else {
double VAR_2;
if ((y <= 2.7629859023376793e+166)) {
VAR_2 = ((double) (x + ((double) (((double) (y / t)) * ((double) (z - x))))));
} else {
double VAR_3;
if ((y <= 1.410066853991718e+272)) {
VAR_3 = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
} else {
VAR_3 = ((double) (x + ((double) (((double) (y / t)) * ((double) (z - x))))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.4 |
|---|---|
| Target | 2.0 |
| Herbie | 1.6 |
if y < -0.0263713862562576194 or 2.7629859023376793e166 < y < 1.41006685399171807e272Initial program 17.1
rmApplied *-un-lft-identity17.1
Applied times-frac2.3
Simplified2.3
if -0.0263713862562576194 < y < -3.80871808056728307e-307Initial program 1.0
if -3.80871808056728307e-307 < y < 2.7629859023376793e166 or 1.41006685399171807e272 < y Initial program 4.3
rmApplied associate-/l*6.3
rmApplied associate-/r/1.7
Final simplification1.6
herbie shell --seed 2020164
(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)))