x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -7.397051135373071984248927387992949000155 \cdot 10^{-100}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;a \le 2.618974838534455632423168448609278208763 \cdot 10^{-91}:\\
\;\;\;\;\frac{1}{a} \cdot \left(\left(z - t\right) \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r182644 = x;
double r182645 = y;
double r182646 = z;
double r182647 = t;
double r182648 = r182646 - r182647;
double r182649 = r182645 * r182648;
double r182650 = a;
double r182651 = r182649 / r182650;
double r182652 = r182644 + r182651;
return r182652;
}
double f(double x, double y, double z, double t, double a) {
double r182653 = a;
double r182654 = -7.397051135373072e-100;
bool r182655 = r182653 <= r182654;
double r182656 = z;
double r182657 = t;
double r182658 = r182656 - r182657;
double r182659 = r182658 / r182653;
double r182660 = y;
double r182661 = x;
double r182662 = fma(r182659, r182660, r182661);
double r182663 = 2.6189748385344556e-91;
bool r182664 = r182653 <= r182663;
double r182665 = 1.0;
double r182666 = r182665 / r182653;
double r182667 = r182658 * r182660;
double r182668 = r182666 * r182667;
double r182669 = r182668 + r182661;
double r182670 = r182660 / r182653;
double r182671 = fma(r182670, r182658, r182661);
double r182672 = r182664 ? r182669 : r182671;
double r182673 = r182655 ? r182662 : r182672;
return r182673;
}




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 | 1.5 |
if a < -7.397051135373072e-100Initial program 7.8
Simplified1.8
rmApplied fma-udef1.8
Simplified1.9
rmApplied associate-/r/1.5
Applied fma-def1.5
if -7.397051135373072e-100 < a < 2.6189748385344556e-91Initial program 1.1
Simplified5.3
rmApplied fma-udef5.3
Simplified4.5
rmApplied div-inv4.6
Applied *-un-lft-identity4.6
Applied times-frac1.2
Simplified1.2
if 2.6189748385344556e-91 < a Initial program 7.4
Simplified1.7
Final simplification1.5
herbie shell --seed 2019325 +o rules:numerics
(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)))