\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -1.27028457940479733 \cdot 10^{287}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{t \cdot z}{a}\\
\mathbf{elif}\;x \cdot y - z \cdot t \le 2.42230842933814323 \cdot 10^{193}:\\
\;\;\;\;\frac{1}{a} \cdot \left(x \cdot y - t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t}{\frac{a}{z}}\\
\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 ((((x * y) - (z * t)) <= -1.2702845794047973e+287)) {
temp = ((x / (a / y)) - ((t * z) / a));
} else {
double temp_1;
if ((((x * y) - (z * t)) <= 2.4223084293381432e+193)) {
temp_1 = ((1.0 / a) * ((x * y) - (t * z)));
} else {
temp_1 = (((x * y) / a) - (t / (a / z)));
}
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 | 7.4 |
|---|---|
| Target | 6.2 |
| Herbie | 4.3 |
if (- (* x y) (* z t)) < -1.2702845794047973e+287Initial program 52.5
rmApplied div-sub52.5
Simplified52.5
rmApplied associate-/l*26.4
if -1.2702845794047973e+287 < (- (* x y) (* z t)) < 2.4223084293381432e+193Initial program 0.8
rmApplied div-sub0.8
Simplified0.8
rmApplied div-inv0.8
Applied div-inv0.9
Applied distribute-rgt-out--0.9
if 2.4223084293381432e+193 < (- (* x y) (* z t)) Initial program 27.3
rmApplied div-sub27.3
Simplified27.3
rmApplied associate-/l*15.3
Final simplification4.3
herbie shell --seed 2020058
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:herbie-target
(if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))
(/ (- (* x y) (* z t)) a))