x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -4.029149003138143098746309211499089505365 \cdot 10^{64}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)\\
\mathbf{elif}\;a \le 5.11858259250166290585004263509549340784 \cdot 10^{-56}:\\
\;\;\;\;\frac{1}{a} \cdot \left(\left(z - t\right) \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\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 r280680 = x;
double r280681 = y;
double r280682 = z;
double r280683 = t;
double r280684 = r280682 - r280683;
double r280685 = r280681 * r280684;
double r280686 = a;
double r280687 = r280685 / r280686;
double r280688 = r280680 + r280687;
return r280688;
}
double f(double x, double y, double z, double t, double a) {
double r280689 = a;
double r280690 = -4.029149003138143e+64;
bool r280691 = r280689 <= r280690;
double r280692 = y;
double r280693 = r280692 / r280689;
double r280694 = z;
double r280695 = t;
double r280696 = r280694 - r280695;
double r280697 = x;
double r280698 = fma(r280693, r280696, r280697);
double r280699 = 5.118582592501663e-56;
bool r280700 = r280689 <= r280699;
double r280701 = 1.0;
double r280702 = r280701 / r280689;
double r280703 = r280696 * r280692;
double r280704 = r280702 * r280703;
double r280705 = r280704 + r280697;
double r280706 = r280696 / r280689;
double r280707 = fma(r280706, r280692, r280697);
double r280708 = r280700 ? r280705 : r280707;
double r280709 = r280691 ? r280698 : r280708;
return r280709;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 6.3 |
|---|---|
| Target | 0.6 |
| Herbie | 1.3 |
if a < -4.029149003138143e+64Initial program 11.4
Simplified2.2
if -4.029149003138143e+64 < a < 5.118582592501663e-56Initial program 1.2
Simplified3.6
rmApplied fma-udef3.6
Simplified3.2
rmApplied div-inv3.3
Applied *-un-lft-identity3.3
Applied times-frac1.4
Simplified1.3
if 5.118582592501663e-56 < a Initial program 8.1
Simplified1.8
rmApplied fma-udef1.8
Simplified2.0
rmApplied *-un-lft-identity2.0
Applied *-un-lft-identity2.0
Applied distribute-lft-out2.0
Simplified0.7
Final simplification1.3
herbie shell --seed 2019305 +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)))