x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -31292472571328848723968 \lor \neg \left(a \le 1.084810071014022110500267120313456275877 \cdot 10^{116}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{a} \cdot \left(\left(z - t\right) \cdot y\right) + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r208336 = x;
double r208337 = y;
double r208338 = z;
double r208339 = t;
double r208340 = r208338 - r208339;
double r208341 = r208337 * r208340;
double r208342 = a;
double r208343 = r208341 / r208342;
double r208344 = r208336 + r208343;
return r208344;
}
double f(double x, double y, double z, double t, double a) {
double r208345 = a;
double r208346 = -3.129247257132885e+22;
bool r208347 = r208345 <= r208346;
double r208348 = 1.0848100710140221e+116;
bool r208349 = r208345 <= r208348;
double r208350 = !r208349;
bool r208351 = r208347 || r208350;
double r208352 = z;
double r208353 = t;
double r208354 = r208352 - r208353;
double r208355 = r208354 / r208345;
double r208356 = y;
double r208357 = x;
double r208358 = fma(r208355, r208356, r208357);
double r208359 = 1.0;
double r208360 = r208359 / r208345;
double r208361 = r208354 * r208356;
double r208362 = r208360 * r208361;
double r208363 = r208362 + r208357;
double r208364 = r208351 ? r208358 : r208363;
return r208364;
}




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.8 |
| Herbie | 1.2 |
if a < -3.129247257132885e+22 or 1.0848100710140221e+116 < a Initial program 10.5
Simplified2.0
rmApplied fma-udef2.0
Simplified2.3
rmApplied *-un-lft-identity2.3
Applied *-un-lft-identity2.3
Applied distribute-lft-out2.3
Simplified0.7
if -3.129247257132885e+22 < a < 1.0848100710140221e+116Initial program 1.6
Simplified3.1
rmApplied fma-udef3.1
Simplified2.8
rmApplied div-inv2.8
Applied *-un-lft-identity2.8
Applied times-frac1.7
Simplified1.7
Final simplification1.2
herbie shell --seed 2019306 +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.07612662163899753e-10) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.8944268627920891e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))