x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - x\right)}{t} \le -5.854653779005750876146040097723722068281 \cdot 10^{293}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)\\
\mathbf{elif}\;x + \frac{y \cdot \left(z - x\right)}{t} \le 1.605413368066265688760018008293374023297 \cdot 10^{299}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{t}}{\frac{1}{z - x}}\\
\end{array}double f(double x, double y, double z, double t) {
double r275342 = x;
double r275343 = y;
double r275344 = z;
double r275345 = r275344 - r275342;
double r275346 = r275343 * r275345;
double r275347 = t;
double r275348 = r275346 / r275347;
double r275349 = r275342 + r275348;
return r275349;
}
double f(double x, double y, double z, double t) {
double r275350 = x;
double r275351 = y;
double r275352 = z;
double r275353 = r275352 - r275350;
double r275354 = r275351 * r275353;
double r275355 = t;
double r275356 = r275354 / r275355;
double r275357 = r275350 + r275356;
double r275358 = -5.854653779005751e+293;
bool r275359 = r275357 <= r275358;
double r275360 = r275351 / r275355;
double r275361 = fma(r275360, r275353, r275350);
double r275362 = 1.6054133680662657e+299;
bool r275363 = r275357 <= r275362;
double r275364 = 1.0;
double r275365 = r275364 / r275353;
double r275366 = r275360 / r275365;
double r275367 = r275350 + r275366;
double r275368 = r275363 ? r275357 : r275367;
double r275369 = r275359 ? r275361 : r275368;
return r275369;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.7 |
|---|---|
| Target | 2.0 |
| Herbie | 0.9 |
if (+ x (/ (* y (- z x)) t)) < -5.854653779005751e+293Initial program 49.2
Simplified1.0
if -5.854653779005751e+293 < (+ x (/ (* y (- z x)) t)) < 1.6054133680662657e+299Initial program 0.8
if 1.6054133680662657e+299 < (+ x (/ (* y (- z x)) t)) Initial program 52.8
rmApplied associate-/l*4.5
rmApplied div-inv4.5
Applied associate-/r*1.0
Final simplification0.9
herbie shell --seed 2020002 +o rules:numerics
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))