\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \leq -1.353344977024385 \cdot 10^{+308} \lor \neg \left(x \cdot y - z \cdot t \leq 2.905993335037001 \cdot 10^{+215}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - z \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
(FPCore (x y z t a)
:precision binary64
(if (or (<= (- (* x y) (* z t)) -1.353344977024385e+308)
(not (<= (- (* x y) (* z t)) 2.905993335037001e+215)))
(- (* x (/ y a)) (* z (/ t a)))
(/ (- (* x y) (* z t)) a)))double code(double x, double y, double z, double t, double a) {
return (((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)))) <= -1.353344977024385e+308) || !(((double) (((double) (x * y)) - ((double) (z * t)))) <= 2.905993335037001e+215))) {
VAR = ((double) (((double) (x * (y / a))) - ((double) (z * (t / a)))));
} else {
VAR = (((double) (((double) (x * y)) - ((double) (z * t)))) / a);
}
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.8 |
|---|---|
| Target | 5.9 |
| Herbie | 0.8 |
if (- (* x y) (* z t)) < -1.35334497702438509e308 or 2.90599333503700119e215 < (- (* x y) (* z t)) Initial program 43.2
rmApplied div-sub43.2
Simplified24.4
Simplified0.8
if -1.35334497702438509e308 < (- (* x y) (* z t)) < 2.90599333503700119e215Initial program 0.7
Final simplification0.8
herbie shell --seed 2020198
(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))