x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(z - x\right) \cdot y}{t} = -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)\\
\mathbf{elif}\;x + \frac{\left(z - x\right) \cdot y}{t} \le 1.011049397526569 \cdot 10^{+308}:\\
\;\;\;\;x + \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)\\
\end{array}double f(double x, double y, double z, double t) {
double r19645795 = x;
double r19645796 = y;
double r19645797 = z;
double r19645798 = r19645797 - r19645795;
double r19645799 = r19645796 * r19645798;
double r19645800 = t;
double r19645801 = r19645799 / r19645800;
double r19645802 = r19645795 + r19645801;
return r19645802;
}
double f(double x, double y, double z, double t) {
double r19645803 = x;
double r19645804 = z;
double r19645805 = r19645804 - r19645803;
double r19645806 = y;
double r19645807 = r19645805 * r19645806;
double r19645808 = t;
double r19645809 = r19645807 / r19645808;
double r19645810 = r19645803 + r19645809;
double r19645811 = -inf.0;
bool r19645812 = r19645810 <= r19645811;
double r19645813 = r19645805 / r19645808;
double r19645814 = fma(r19645813, r19645806, r19645803);
double r19645815 = 1.011049397526569e+308;
bool r19645816 = r19645810 <= r19645815;
double r19645817 = r19645816 ? r19645810 : r19645814;
double r19645818 = r19645812 ? r19645814 : r19645817;
return r19645818;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.1 |
|---|---|
| Target | 2.0 |
| Herbie | 0.7 |
if (+ x (/ (* y (- z x)) t)) < -inf.0 or 1.011049397526569e+308 < (+ x (/ (* y (- z x)) t)) Initial program 60.2
Simplified0.2
if -inf.0 < (+ x (/ (* y (- z x)) t)) < 1.011049397526569e+308Initial program 0.8
Final simplification0.7
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))