x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -2.49706583532450338 \cdot 10^{32}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \le 6.520793096727247 \cdot 10^{-105}:\\
\;\;\;\;x + \frac{1}{a} \cdot \left(\left(z - t\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{a} \cdot y\\
\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.4970658353245034e+32)) {
VAR = ((double) (x + ((double) (y / ((double) (a / ((double) (z - t))))))));
} else {
double VAR_1;
if ((y <= 6.520793096727247e-105)) {
VAR_1 = ((double) (x + ((double) (((double) (1.0 / a)) * ((double) (((double) (z - t)) * y))))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (((double) (z - t)) / a)) * y))));
}
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 | 6.0 |
|---|---|
| Target | 0.7 |
| Herbie | 1.1 |
if y < -2.4970658353245034e+32Initial program 17.1
rmApplied *-commutative17.1
Applied associate-/l*3.9
rmApplied associate-/r/1.0
rmApplied clear-num1.2
Applied associate-*l/1.1
Simplified1.1
if -2.4970658353245034e+32 < y < 6.520793096727247e-105Initial program 0.5
rmApplied *-commutative0.5
Applied associate-/l*2.0
rmApplied div-inv2.1
Applied *-un-lft-identity2.1
Applied times-frac0.6
Simplified0.6
if 6.520793096727247e-105 < y Initial program 9.8
rmApplied *-commutative9.8
Applied associate-/l*2.6
rmApplied associate-/r/1.9
Final simplification1.1
herbie shell --seed 2020114
(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)))