\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -1.382041856187151941628952525789930687569 \cdot 10^{163}:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t \cdot z}{a}\\
\mathbf{elif}\;x \cdot y - z \cdot t \le 1.405304208610043958519867955179698881269 \cdot 10^{146}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{a} - \frac{t \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{1}{\frac{\frac{a}{t}}{z}}\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r875284 = x;
double r875285 = y;
double r875286 = r875284 * r875285;
double r875287 = z;
double r875288 = t;
double r875289 = r875287 * r875288;
double r875290 = r875286 - r875289;
double r875291 = a;
double r875292 = r875290 / r875291;
return r875292;
}
double f(double x, double y, double z, double t, double a) {
double r875293 = x;
double r875294 = y;
double r875295 = r875293 * r875294;
double r875296 = z;
double r875297 = t;
double r875298 = r875296 * r875297;
double r875299 = r875295 - r875298;
double r875300 = -1.382041856187152e+163;
bool r875301 = r875299 <= r875300;
double r875302 = a;
double r875303 = r875294 / r875302;
double r875304 = r875293 * r875303;
double r875305 = r875297 * r875296;
double r875306 = r875305 / r875302;
double r875307 = r875304 - r875306;
double r875308 = 1.405304208610044e+146;
bool r875309 = r875299 <= r875308;
double r875310 = 1.0;
double r875311 = r875310 / r875302;
double r875312 = r875295 * r875311;
double r875313 = r875312 - r875306;
double r875314 = r875295 / r875302;
double r875315 = r875302 / r875297;
double r875316 = r875315 / r875296;
double r875317 = r875310 / r875316;
double r875318 = r875314 - r875317;
double r875319 = r875309 ? r875313 : r875318;
double r875320 = r875301 ? r875307 : r875319;
return r875320;
}




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.0 |
| Herbie | 4.5 |
if (- (* x y) (* z t)) < -1.382041856187152e+163Initial program 22.1
rmApplied div-sub22.1
Simplified22.1
rmApplied *-un-lft-identity22.1
Applied times-frac11.8
Simplified11.8
if -1.382041856187152e+163 < (- (* x y) (* z t)) < 1.405304208610044e+146Initial program 1.0
rmApplied div-sub1.0
Simplified1.0
rmApplied div-inv1.0
if 1.405304208610044e+146 < (- (* x y) (* z t)) Initial program 19.9
rmApplied div-sub19.9
Simplified19.9
rmApplied clear-num19.9
rmApplied associate-/r*11.5
Final simplification4.5
herbie shell --seed 2019356
(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))