x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -1272558208.55477428436279296875:\\
\;\;\;\;x - y \cdot \left(\frac{t}{a} - \frac{z}{a}\right)\\
\mathbf{elif}\;a \le 3.071173039328613373912527296282876331673 \cdot 10^{-45}:\\
\;\;\;\;x - \left(\left(t - z\right) \cdot y\right) \cdot \frac{1}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \left(\frac{t}{\frac{a}{y}} - \frac{y}{\frac{a}{z}}\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r124713 = x;
double r124714 = y;
double r124715 = z;
double r124716 = t;
double r124717 = r124715 - r124716;
double r124718 = r124714 * r124717;
double r124719 = a;
double r124720 = r124718 / r124719;
double r124721 = r124713 + r124720;
return r124721;
}
double f(double x, double y, double z, double t, double a) {
double r124722 = a;
double r124723 = -1272558208.5547743;
bool r124724 = r124722 <= r124723;
double r124725 = x;
double r124726 = y;
double r124727 = t;
double r124728 = r124727 / r124722;
double r124729 = z;
double r124730 = r124729 / r124722;
double r124731 = r124728 - r124730;
double r124732 = r124726 * r124731;
double r124733 = r124725 - r124732;
double r124734 = 3.0711730393286134e-45;
bool r124735 = r124722 <= r124734;
double r124736 = r124727 - r124729;
double r124737 = r124736 * r124726;
double r124738 = 1.0;
double r124739 = r124738 / r124722;
double r124740 = r124737 * r124739;
double r124741 = r124725 - r124740;
double r124742 = r124722 / r124726;
double r124743 = r124727 / r124742;
double r124744 = r124722 / r124729;
double r124745 = r124726 / r124744;
double r124746 = r124743 - r124745;
double r124747 = r124725 - r124746;
double r124748 = r124735 ? r124741 : r124747;
double r124749 = r124724 ? r124733 : r124748;
return r124749;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.4 |
|---|---|
| Target | 0.7 |
| Herbie | 0.9 |
if a < -1272558208.5547743Initial program 9.7
Simplified2.1
rmApplied add-cube-cbrt2.5
Applied associate-*l*2.5
Taylor expanded around 0 9.7
Simplified0.5
if -1272558208.5547743 < a < 3.0711730393286134e-45Initial program 1.0
Simplified4.1
rmApplied *-commutative4.1
rmApplied div-inv4.1
Applied associate-*r*1.0
if 3.0711730393286134e-45 < a Initial program 8.9
Simplified1.6
rmApplied add-cube-cbrt2.1
Applied associate-*l*2.1
rmApplied add-cube-cbrt2.1
Applied add-cube-cbrt2.1
Applied times-frac2.1
Applied cbrt-prod2.1
Simplified2.1
Taylor expanded around 0 8.9
Simplified1.3
Final simplification0.9
herbie shell --seed 2019196
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:herbie-target
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))