\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y - z \cdot t}{a} = -inf.0:\\
\;\;\;\;\left(\frac{y}{\frac{{a}^{\frac{2}{3}}}{x}} - \frac{t}{\frac{{a}^{\frac{2}{3}}}{z}}\right) \cdot \frac{1}{\sqrt[3]{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\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) (((double) (x * y)) - ((double) (z * t)))) / a)) <= -inf.0)) {
VAR = ((double) (((double) (((double) (y / ((double) (((double) pow(a, 0.6666666666666666)) / x)))) - ((double) (t / ((double) (((double) pow(a, 0.6666666666666666)) / z)))))) * ((double) (1.0 / ((double) cbrt(a))))));
} else {
VAR = ((double) (((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.5 |
|---|---|
| Target | 5.8 |
| Herbie | 6.3 |
if (/ (- (* x y) (* z t)) a) < -inf.0Initial program 64.0
rmApplied div-inv64.0
rmApplied add-cube-cbrt64.0
Applied *-un-lft-identity64.0
Applied times-frac64.0
Applied associate-*r*64.0
Simplified64.0
rmApplied div-sub64.0
Simplified54.4
Simplified41.1
if -inf.0 < (/ (- (* x y) (* z t)) a) Initial program 4.4
Final simplification6.3
herbie shell --seed 2020147
(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))