\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -4.907070607372141880864841580634098716505 \cdot 10^{217}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{t}{a} \cdot z\\
\mathbf{elif}\;x \cdot y - z \cdot t \le 3.609009921587506181399030317787405384418 \cdot 10^{247}:\\
\;\;\;\;\frac{1}{a} \cdot \left(x \cdot y - z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{t}{a} \cdot z\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r37364146 = x;
double r37364147 = y;
double r37364148 = r37364146 * r37364147;
double r37364149 = z;
double r37364150 = t;
double r37364151 = r37364149 * r37364150;
double r37364152 = r37364148 - r37364151;
double r37364153 = a;
double r37364154 = r37364152 / r37364153;
return r37364154;
}
double f(double x, double y, double z, double t, double a) {
double r37364155 = x;
double r37364156 = y;
double r37364157 = r37364155 * r37364156;
double r37364158 = z;
double r37364159 = t;
double r37364160 = r37364158 * r37364159;
double r37364161 = r37364157 - r37364160;
double r37364162 = -4.907070607372142e+217;
bool r37364163 = r37364161 <= r37364162;
double r37364164 = a;
double r37364165 = r37364164 / r37364156;
double r37364166 = r37364155 / r37364165;
double r37364167 = r37364159 / r37364164;
double r37364168 = r37364167 * r37364158;
double r37364169 = r37364166 - r37364168;
double r37364170 = 3.609009921587506e+247;
bool r37364171 = r37364161 <= r37364170;
double r37364172 = 1.0;
double r37364173 = r37364172 / r37364164;
double r37364174 = r37364173 * r37364161;
double r37364175 = r37364171 ? r37364174 : r37364169;
double r37364176 = r37364163 ? r37364169 : r37364175;
return r37364176;
}




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.2 |
| Herbie | 0.8 |
if (- (* x y) (* z t)) < -4.907070607372142e+217 or 3.609009921587506e+247 < (- (* x y) (* z t)) Initial program 36.3
rmApplied div-sub36.3
rmApplied associate-/l*20.3
rmApplied *-un-lft-identity20.3
Applied times-frac0.8
Simplified0.8
if -4.907070607372142e+217 < (- (* x y) (* z t)) < 3.609009921587506e+247Initial program 0.7
rmApplied div-sub0.7
rmApplied div-inv0.7
Applied div-inv0.8
Applied distribute-rgt-out--0.8
Final simplification0.8
herbie shell --seed 2019169
(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))