\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;z \cdot t \le -3.18624459217187986 \cdot 10^{52}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;z \cdot t \le -9.7526479675253164 \cdot 10^{-297}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{t \cdot z}{a}\\
\mathbf{elif}\;z \cdot t \le 5.1148514294461227 \cdot 10^{247}:\\
\;\;\;\;\left(x \cdot y - z \cdot t\right) \cdot \frac{1}{a}\\
\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 ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / a));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (z * t)) <= -3.18624459217188e+52)) {
VAR = ((double) (((double) (((double) (x * y)) / a)) - ((double) (t / ((double) (a / z))))));
} else {
double VAR_1;
if ((((double) (z * t)) <= -9.752647967525316e-297)) {
VAR_1 = ((double) (((double) (x / ((double) (a / y)))) - ((double) (((double) (t * z)) / a))));
} else {
double VAR_2;
if ((((double) (z * t)) <= 5.114851429446123e+247)) {
VAR_2 = ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) * ((double) (1.0 / a))));
} else {
VAR_2 = ((double) (((double) (((double) (x * y)) / a)) - ((double) (t / ((double) (a / z))))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




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.0 |
| Herbie | 5.7 |
if (* z t) < -3.18624459217187986e52 or 5.1148514294461227e247 < (* z t) Initial program 20.7
rmApplied div-sub20.7
Simplified20.7
rmApplied associate-/l*7.6
if -3.18624459217187986e52 < (* z t) < -9.7526479675253164e-297Initial program 3.1
rmApplied div-sub3.1
Simplified3.1
rmApplied associate-/l*6.4
if -9.7526479675253164e-297 < (* z t) < 5.1148514294461227e247Initial program 4.5
rmApplied div-inv4.5
Final simplification5.7
herbie shell --seed 2020161
(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))