\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y - z \cdot t}{a} = -inf.0 \lor \neg \left(\frac{x \cdot y - z \cdot t}{a} \le 3.18147716746686438 \cdot 10^{304}\right):\\
\;\;\;\;\left(\frac{x \cdot \left(y \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}} - \frac{t \cdot \left(z \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}}\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) || !(((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / a)) <= 3.1814771674668644e+304))) {
VAR = ((double) (((double) (((double) (((double) (x * ((double) (y * ((double) exp(((double) (0.3333333333333333 * ((double) (((double) log(1.0)) + ((double) (2.0 * ((double) log(((double) (-1.0 / a)))))))))))))))) / ((double) pow(((double) cbrt(-1.0)), 2.0)))) - ((double) (((double) (t * ((double) (z * ((double) exp(((double) (0.3333333333333333 * ((double) (((double) log(1.0)) + ((double) (2.0 * ((double) log(((double) (-1.0 / a)))))))))))))))) / ((double) pow(((double) cbrt(-1.0)), 2.0)))))) * ((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.4 |
|---|---|
| Target | 6.1 |
| Herbie | 5.0 |
if (/ (- (* x y) (* z t)) a) < -inf.0 or 3.18147716746686438e304 < (/ (- (* x y) (* z t)) a) Initial program 62.5
rmApplied div-inv62.5
rmApplied add-cube-cbrt62.5
Applied *-un-lft-identity62.5
Applied times-frac62.5
Applied associate-*r*62.5
Simplified62.5
Taylor expanded around -inf 40.4
if -inf.0 < (/ (- (* x y) (* z t)) a) < 3.18147716746686438e304Initial program 0.7
Final simplification5.0
herbie shell --seed 2020148
(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))