x - \frac{y \cdot \left(z - t\right)}{a}
\begin{array}{l}
\mathbf{if}\;a \leq -280431850242306000:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;a \leq 9.357780273859336 \cdot 10^{+52}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a}, x\right)\\
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
(FPCore (x y z t a)
:precision binary64
(if (<= a -280431850242306000.0)
(- x (/ y (/ a (- z t))))
(if (<= a 9.357780273859336e+52)
(- x (/ (* y (- z t)) a))
(fma y (/ (- t z) a) x))))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 tmp;
if (a <= -280431850242306000.0) {
tmp = x - (y / (a / (z - t)));
} else if (a <= 9.357780273859336e+52) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = fma(y, ((t - z) / a), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 6.1 |
|---|---|
| Target | 0.7 |
| Herbie | 0.7 |
if a < -280431850242305980Initial program 9.5
Applied associate-/l*_binary640.5
if -280431850242305980 < a < 9.3577802738593356e52Initial program 0.9
if 9.3577802738593356e52 < a Initial program 10.6
Simplified0.6
Final simplification0.7
herbie shell --seed 2021275
(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)))