\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -3.339667653993158922458762552949546866149 \cdot 10^{287} \lor \neg \left(x \cdot y - z \cdot t \le 4.681279714610344744150833825920741179863 \cdot 10^{292}\right):\\
\;\;\;\;\frac{x}{a} \cdot y - \frac{t}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r657791 = x;
double r657792 = y;
double r657793 = r657791 * r657792;
double r657794 = z;
double r657795 = t;
double r657796 = r657794 * r657795;
double r657797 = r657793 - r657796;
double r657798 = a;
double r657799 = r657797 / r657798;
return r657799;
}
double f(double x, double y, double z, double t, double a) {
double r657800 = x;
double r657801 = y;
double r657802 = r657800 * r657801;
double r657803 = z;
double r657804 = t;
double r657805 = r657803 * r657804;
double r657806 = r657802 - r657805;
double r657807 = -3.339667653993159e+287;
bool r657808 = r657806 <= r657807;
double r657809 = 4.681279714610345e+292;
bool r657810 = r657806 <= r657809;
double r657811 = !r657810;
bool r657812 = r657808 || r657811;
double r657813 = a;
double r657814 = r657800 / r657813;
double r657815 = r657814 * r657801;
double r657816 = r657804 / r657813;
double r657817 = r657816 * r657803;
double r657818 = r657815 - r657817;
double r657819 = r657806 / r657813;
double r657820 = r657812 ? r657818 : r657819;
return r657820;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 7.6 |
|---|---|
| Target | 5.8 |
| Herbie | 0.7 |
if (- (* x y) (* z t)) < -3.339667653993159e+287 or 4.681279714610345e+292 < (- (* x y) (* z t)) Initial program 54.1
rmApplied div-sub54.1
Simplified30.9
Simplified0.3
Taylor expanded around 0 30.9
Simplified0.3
if -3.339667653993159e+287 < (- (* x y) (* z t)) < 4.681279714610345e+292Initial program 0.8
rmApplied clear-num1.1
rmApplied *-un-lft-identity1.1
Applied *-un-lft-identity1.1
Applied times-frac1.1
Applied add-cube-cbrt1.1
Applied times-frac1.1
Simplified1.1
Simplified0.8
Final simplification0.7
herbie shell --seed 2019194
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
: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))