\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -4.3021896380690273 \cdot 10^{112} \lor \neg \left(x \cdot y - z \cdot t \le 1.7942916557536299 \cdot 10^{219}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - t \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{x \cdot y - z \cdot t}}\\
\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) (((double) (x * y)) - ((double) (z * t)))) <= -4.302189638069027e+112) || !(((double) (((double) (x * y)) - ((double) (z * t)))) <= 1.79429165575363e+219))) {
VAR = ((double) (((double) (x * ((double) (y / a)))) - ((double) (t * ((double) (z / a))))));
} else {
VAR = ((double) (1.0 / ((double) (a / ((double) (((double) (x * y)) - ((double) (z * t))))))));
}
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.2 |
|---|---|
| Target | 5.8 |
| Herbie | 1.8 |
if (- (* x y) (* z t)) < -4.302189638069027e+112 or 1.79429165575363e+219 < (- (* x y) (* z t)) Initial program 21.2
rmApplied div-sub21.2
Simplified21.2
rmApplied associate-/l*12.8
rmApplied *-un-lft-identity12.8
Applied times-frac3.0
Simplified3.0
rmApplied div-inv3.1
Simplified3.0
if -4.302189638069027e+112 < (- (* x y) (* z t)) < 1.79429165575363e+219Initial program 0.9
rmApplied clear-num1.3
Final simplification1.8
herbie shell --seed 2020140
(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))