x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -2.5555026040340327 \cdot 10^{-76} \lor \neg \left(y \le 236520.52657286497\right):\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{a} \cdot \left(z - t\right)\\
\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 <= -2.5555026040340327e-76) || !(y <= 236520.52657286497))) {
VAR = ((double) (x - ((double) (y * ((double) (((double) (z - t)) / a))))));
} else {
VAR = ((double) (x - ((double) (((double) (y / a)) * ((double) (z - t))))));
}
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 < -2.5555026040340327e-76 or 236520.52657286497 < y Initial program 12.8
rmApplied *-un-lft-identity12.8
Applied times-frac1.3
Simplified1.3
if -2.5555026040340327e-76 < y < 236520.52657286497Initial program 0.6
rmApplied associate-/l*9.5
rmApplied associate-/r/1.7
Final simplification1.5
herbie shell --seed 2020121
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))