x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;y \le -8.7772396722328355 \cdot 10^{103}:\\
\;\;\;\;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 <= -8.777239672232835e+103)) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
} else {
VAR = ((double) (x + ((double) (((double) (y / t)) * ((double) (z - x))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.3 |
|---|---|
| Target | 2.2 |
| Herbie | 1.8 |
if y < -8.7772396722328355e103Initial program 21.9
rmApplied *-un-lft-identity21.9
Applied times-frac2.5
Simplified2.5
if -8.7772396722328355e103 < y Initial program 4.5
rmApplied associate-/l*6.1
rmApplied associate-/r/1.8
Final simplification1.8
herbie shell --seed 2020155
(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)))