x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \leq -2.7341664699093905 \cdot 10^{-15} \lor \neg \left(a \leq 3.6035247661278024 \cdot 10^{-16}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(t - z\right)\right) \cdot \frac{1}{a}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x - (((double) (y * ((double) (z - t)))) / a)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((a <= -2.7341664699093905e-15) || !(a <= 3.6035247661278024e-16))) {
VAR = ((double) (x + (y / (a / ((double) (t - z))))));
} else {
VAR = ((double) (x + ((double) (((double) (y * ((double) (t - z)))) * (1.0 / a)))));
}
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.6 |
| Herbie | 0.6 |
if a < -2.7341664699093905e-15 or 3.6035247661278024e-16 < a Initial program Error: 8.7 bits
SimplifiedError: 0.5 bits
rmApplied clear-numError: 0.5 bits
rmApplied un-div-invError: 0.5 bits
if -2.7341664699093905e-15 < a < 3.6035247661278024e-16Initial program Error: 0.8 bits
SimplifiedError: 16.5 bits
rmApplied div-invError: 16.5 bits
Applied associate-*r*Error: 0.9 bits
Final simplificationError: 0.6 bits
herbie shell --seed 2020200
(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.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))