\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t = -\infty \lor \neg \left(x \cdot y - z \cdot t \le 1.1925199982606428 \cdot 10^{305}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\sqrt[3]{a} \cdot \sqrt[3]{a}}, \frac{y}{\sqrt[3]{a}}, -\frac{z}{\sqrt[3]{a}} \cdot \frac{t}{\sqrt[3]{a} \cdot \sqrt[3]{a}}\right) + \frac{t}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \left(\left(-\frac{z}{\sqrt[3]{a}}\right) + \frac{z}{\sqrt[3]{a}}\right)\\
\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 (((x * y) - (z * t)) / a);
}
double code(double x, double y, double z, double t, double a) {
double temp;
if (((((x * y) - (z * t)) <= -inf.0) || !(((x * y) - (z * t)) <= 1.1925199982606428e+305))) {
temp = (fma((x / (cbrt(a) * cbrt(a))), (y / cbrt(a)), -((z / cbrt(a)) * (t / (cbrt(a) * cbrt(a))))) + ((t / (cbrt(a) * cbrt(a))) * (-(z / cbrt(a)) + (z / cbrt(a)))));
} else {
temp = (1.0 / (a / ((x * y) - (z * t))));
}
return temp;
}




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.2 |
| Herbie | 1.0 |
if (- (* x y) (* z t)) < -inf.0 or 1.1925199982606428e+305 < (- (* x y) (* z t)) Initial program 63.3
rmApplied div-sub63.3
Simplified63.3
rmApplied add-cube-cbrt63.3
Applied times-frac35.2
Applied add-cube-cbrt35.2
Applied times-frac1.3
Applied prod-diff1.3
Simplified1.3
if -inf.0 < (- (* x y) (* z t)) < 1.1925199982606428e+305Initial program 0.7
rmApplied clear-num1.0
Final simplification1.0
herbie shell --seed 2020058 +o rules:numerics
(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))