\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;z \cdot t \le -8.0070948443668391 \cdot 10^{300}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;z \cdot t \le -8.6807024211344991 \cdot 10^{-183}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{t \cdot z}{a}\\
\mathbf{elif}\;z \cdot t \le 8.56722134275957997 \cdot 10^{-146}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t \cdot z}{a}\\
\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)) <= -8.007094844366839e+300)) {
VAR = ((double) (((double) (((double) (x * y)) / a)) - ((double) (t / ((double) (a / z))))));
} else {
double VAR_1;
if ((((double) (z * t)) <= -8.680702421134499e-183)) {
VAR_1 = ((double) (((double) (x / ((double) (a / y)))) - ((double) (((double) (t * z)) / a))));
} else {
double VAR_2;
if ((((double) (z * t)) <= 8.56722134275958e-146)) {
VAR_2 = ((double) (((double) (((double) (x * y)) / a)) - ((double) (t / ((double) (a / z))))));
} else {
VAR_2 = ((double) (((double) (x * ((double) (y / a)))) - ((double) (((double) (t * z)) / a))));
}
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.7 |
|---|---|
| Target | 5.8 |
| Herbie | 5.5 |
if (* z t) < -8.007094844366839e+300 or -8.680702421134499e-183 < (* z t) < 8.56722134275958e-146Initial program 10.4
rmApplied div-sub10.4
Simplified10.4
rmApplied associate-/l*5.0
if -8.007094844366839e+300 < (* z t) < -8.680702421134499e-183Initial program 3.9
rmApplied div-sub3.9
Simplified3.9
rmApplied associate-/l*3.8
if 8.56722134275958e-146 < (* z t) Initial program 8.8
rmApplied div-sub8.8
Simplified8.8
rmApplied *-un-lft-identity8.8
Applied times-frac7.7
Simplified7.7
Final simplification5.5
herbie shell --seed 2020123
(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))