x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -7.85605156347425887 \cdot 10^{86}:\\
\;\;\;\;x + \frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{z - t}{\sqrt[3]{a}}\\
\mathbf{elif}\;a \le 1.75993203164165999 \cdot 10^{-29}:\\
\;\;\;\;x + \frac{1}{a} \cdot \left(\left(z - t\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + ((y * (z - t)) / a));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if ((a <= -7.856051563474259e+86)) {
temp = (x + ((y / (cbrt(a) * cbrt(a))) * ((z - t) / cbrt(a))));
} else {
double temp_1;
if ((a <= 1.75993203164166e-29)) {
temp_1 = (x + ((1.0 / a) * ((z - t) * y)));
} else {
temp_1 = (x + (y * ((z - t) / a)));
}
temp = temp_1;
}
return temp;
}




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 | 1.1 |
if a < -7.856051563474259e+86Initial program 12.1
rmApplied add-cube-cbrt12.3
Applied times-frac1.3
if -7.856051563474259e+86 < a < 1.75993203164166e-29Initial program 1.4
rmApplied clear-num1.4
rmApplied associate-/r*2.9
rmApplied *-un-lft-identity2.9
Applied div-inv2.9
Applied times-frac1.5
Applied add-cube-cbrt1.5
Applied times-frac1.6
Simplified1.6
Simplified1.4
if 1.75993203164166e-29 < a Initial program 9.1
rmApplied *-un-lft-identity9.1
Applied times-frac0.5
Simplified0.5
Final simplification1.1
herbie shell --seed 2020060
(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.0761266216389975e-10) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))