x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -1.96605357789947992 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{elif}\;a \le 1.23690458140457419 \cdot 10^{-16}:\\
\;\;\;\;1 \cdot \frac{\left(z - t\right) \cdot y}{a} + x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r280845 = x;
double r280846 = y;
double r280847 = z;
double r280848 = t;
double r280849 = r280847 - r280848;
double r280850 = r280846 * r280849;
double r280851 = a;
double r280852 = r280850 / r280851;
double r280853 = r280845 + r280852;
return r280853;
}
double f(double x, double y, double z, double t, double a) {
double r280854 = a;
double r280855 = -1.96605357789948e-23;
bool r280856 = r280854 <= r280855;
double r280857 = x;
double r280858 = y;
double r280859 = r280858 / r280854;
double r280860 = z;
double r280861 = t;
double r280862 = r280860 - r280861;
double r280863 = r280859 * r280862;
double r280864 = r280857 + r280863;
double r280865 = 1.2369045814045742e-16;
bool r280866 = r280854 <= r280865;
double r280867 = 1.0;
double r280868 = r280862 * r280858;
double r280869 = r280868 / r280854;
double r280870 = r280867 * r280869;
double r280871 = r280870 + r280857;
double r280872 = r280862 / r280854;
double r280873 = fma(r280872, r280858, r280857);
double r280874 = r280867 * r280873;
double r280875 = r280866 ? r280871 : r280874;
double r280876 = r280856 ? r280864 : r280875;
return r280876;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 6.4 |
|---|---|
| Target | 0.7 |
| Herbie | 1.1 |
if a < -1.96605357789948e-23Initial program 9.3
Simplified1.9
rmApplied fma-udef1.9
rmApplied +-commutative1.9
if -1.96605357789948e-23 < a < 1.2369045814045742e-16Initial program 0.9
Simplified3.7
rmApplied fma-udef3.7
rmApplied *-un-lft-identity3.7
Applied associate-*l*3.7
Simplified0.9
if 1.2369045814045742e-16 < a Initial program 9.4
Simplified1.6
rmApplied fma-udef1.6
rmApplied *-un-lft-identity1.6
Applied associate-*l*1.6
Simplified9.4
rmApplied *-un-lft-identity9.4
Applied distribute-lft-out9.4
Simplified0.5
Final simplification1.1
herbie shell --seed 2020060 +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)))