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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 6.0 |
|---|---|
| Target | 0.7 |
| Herbie | 0.7 |
if a < -6.55802451989578224e52 or 5.64767855409655602e-33 < a Initial program 9.4
Simplified0.5
if -6.55802451989578224e52 < a < 5.64767855409655602e-33Initial program 1.0
Final simplification0.7
herbie shell --seed 2022004
(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.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)))