\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \leq -2.6682022131357653 \cdot 10^{+265} \lor \neg \left(x \cdot y - z \cdot t \leq 2.1694896140747828 \cdot 10^{+201}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\
\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)) -2.6682022131357653e+265)
(not (<= (- (* x y) (* z t)) 2.1694896140747828e+201)))
(- (* x (/ y a)) (/ t (/ a z)))
(/ (- (* x y) (* z t)) a)))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 tmp;
if ((((x * y) - (z * t)) <= -2.6682022131357653e+265) || !(((x * y) - (z * t)) <= 2.1694896140747828e+201)) {
tmp = (x * (y / a)) - (t / (a / z));
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 7.5 |
|---|---|
| Target | 5.9 |
| Herbie | 0.8 |
if (-.f64 (*.f64 x y) (*.f64 z t)) < -2.6682022131357653e265 or 2.1694896140747828e201 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 34.5
rmApplied div-sub_binary64_1815634.5
Simplified18.3
rmApplied *-un-lft-identity_binary64_1815118.3
Applied times-frac_binary64_181570.9
Simplified0.9
if -2.6682022131357653e265 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.1694896140747828e201Initial program 0.7
Final simplification0.8
herbie shell --seed 2021176
(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))