x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} \le -1.12781794626461071 \cdot 10^{302}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \le -1.57571923092794138 \cdot 10^{-162}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + ((y * (z - t)) / a));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((y * (z - t)) / a) <= -1.1278179462646107e+302)) {
VAR = (x + (y * ((z - t) / a)));
} else {
double VAR_1;
if ((((y * (z - t)) / a) <= -1.5757192309279414e-162)) {
VAR_1 = (x + ((y * (z - t)) / a));
} else {
VAR_1 = fma((y / a), (z - t), x);
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 5.9 |
|---|---|
| Target | 0.7 |
| Herbie | 1.7 |
if (/ (* y (- z t)) a) < -1.1278179462646107e+302Initial program 57.9
rmApplied *-un-lft-identity57.9
Applied times-frac3.3
Simplified3.3
if -1.1278179462646107e+302 < (/ (* y (- z t)) a) < -1.5757192309279414e-162Initial program 0.2
if -1.5757192309279414e-162 < (/ (* y (- z t)) a) Initial program 5.0
Simplified2.3
Final simplification1.7
herbie shell --seed 2020075 +o rules:numerics
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))