x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -6.072638126039449 \cdot 10^{-79} \lor \neg \left(y \le 236520.52657286497\right):\\
\;\;\;\;y \cdot \frac{z - t}{a} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(z - t\right) + x\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / a))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((y <= -6.072638126039449e-79) || !(y <= 236520.52657286497))) {
VAR = ((double) (((double) (y * ((double) (((double) (z - t)) / a)))) + x));
} else {
VAR = ((double) (((double) (((double) (y / a)) * ((double) (z - t)))) + x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.1 |
|---|---|
| Target | 0.8 |
| Herbie | 1.5 |
if y < -6.072638126039449e-79 or 236520.52657286497 < y Initial program 12.7
Simplified3.1
rmApplied fma-udef3.1
rmApplied div-inv3.2
Applied associate-*l*1.4
Simplified1.3
if -6.072638126039449e-79 < y < 236520.52657286497Initial program 0.6
Simplified1.7
rmApplied fma-udef1.7
Final simplification1.5
herbie shell --seed 2020121 +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)))