\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -1.42769642305035037 \cdot 10^{138} \lor \neg \left(x \cdot y - z \cdot t \le 5.05725067830339464 \cdot 10^{219}\right):\\
\;\;\;\;y \cdot \frac{x}{a} - t \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)}{\frac{a}{\sqrt[3]{z}}}\\
\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)))) <= -1.4276964230503504e+138) || !(((double) (((double) (x * y)) - ((double) (z * t)))) <= 5.0572506783033946e+219))) {
VAR = ((double) (((double) (y * ((double) (x / a)))) - ((double) (t * ((double) (z / a))))));
} else {
VAR = ((double) (((double) (((double) (x * y)) / a)) - ((double) (((double) (t * ((double) (((double) cbrt(z)) * ((double) cbrt(z)))))) / ((double) (a / ((double) cbrt(z))))))));
}
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 | 6.3 |
| Herbie | 2.2 |
if (- (* x y) (* z t)) < -1.4276964230503504e+138 or 5.0572506783033946e+219 < (- (* x y) (* z t)) Initial program 24.7
rmApplied div-sub24.7
Simplified24.7
rmApplied *-un-lft-identity24.7
Applied times-frac14.0
Simplified14.0
rmApplied *-un-lft-identity14.0
Applied *-commutative14.0
Applied times-frac2.2
Simplified2.2
if -1.4276964230503504e+138 < (- (* x y) (* z t)) < 5.0572506783033946e+219Initial program 0.8
rmApplied div-sub0.8
Simplified0.8
rmApplied *-un-lft-identity0.8
Applied times-frac5.9
Simplified5.9
rmApplied add-cube-cbrt6.3
Applied associate-/l*6.3
Applied associate-*r/2.2
Final simplification2.2
herbie shell --seed 2020114
(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))