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 r21312271 = x;
double r21312272 = y;
double r21312273 = z;
double r21312274 = r21312273 - r21312271;
double r21312275 = r21312272 * r21312274;
double r21312276 = t;
double r21312277 = r21312275 / r21312276;
double r21312278 = r21312271 + r21312277;
return r21312278;
}
double f(double x, double y, double z, double t) {
double r21312279 = x;
double r21312280 = z;
double r21312281 = r21312280 - r21312279;
double r21312282 = y;
double r21312283 = r21312281 * r21312282;
double r21312284 = t;
double r21312285 = r21312283 / r21312284;
double r21312286 = r21312279 + r21312285;
double r21312287 = -inf.0;
bool r21312288 = r21312286 <= r21312287;
double r21312289 = r21312281 / r21312284;
double r21312290 = fma(r21312289, r21312282, r21312279);
double r21312291 = 1.011049397526569e+308;
bool r21312292 = r21312286 <= r21312291;
double r21312293 = r21312292 ? r21312286 : r21312290;
double r21312294 = r21312288 ? r21312290 : r21312293;
return r21312294;
}




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)))