\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le 2.15608682219969581 \cdot 10^{302}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\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}}\\
\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)))) <= 2.1560868221996958e+302)) {
VAR = ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / a));
} else {
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))))));
}
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.4 |
if (- (* x y) (* z t)) < 2.15608682219969581e302Initial program 4.2
if 2.15608682219969581e302 < (- (* x y) (* z t)) Initial program 62.1
rmApplied div-inv62.1
rmApplied add-cube-cbrt62.2
Applied *-un-lft-identity62.2
Applied times-frac62.2
Applied associate-*r*62.2
Simplified62.2
Taylor expanded around -inf 43.7
Final simplification6.4
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))