\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t = -\infty \lor \neg \left(x \cdot y - z \cdot t \le 6.823892997990362310076105741944369198968 \cdot 10^{254}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot y, \frac{1}{a}, -\frac{t \cdot z}{a}\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r1114391 = x;
double r1114392 = y;
double r1114393 = r1114391 * r1114392;
double r1114394 = z;
double r1114395 = t;
double r1114396 = r1114394 * r1114395;
double r1114397 = r1114393 - r1114396;
double r1114398 = a;
double r1114399 = r1114397 / r1114398;
return r1114399;
}
double f(double x, double y, double z, double t, double a) {
double r1114400 = x;
double r1114401 = y;
double r1114402 = r1114400 * r1114401;
double r1114403 = z;
double r1114404 = t;
double r1114405 = r1114403 * r1114404;
double r1114406 = r1114402 - r1114405;
double r1114407 = -inf.0;
bool r1114408 = r1114406 <= r1114407;
double r1114409 = 6.823892997990362e+254;
bool r1114410 = r1114406 <= r1114409;
double r1114411 = !r1114410;
bool r1114412 = r1114408 || r1114411;
double r1114413 = a;
double r1114414 = r1114413 / r1114401;
double r1114415 = r1114400 / r1114414;
double r1114416 = r1114413 / r1114403;
double r1114417 = r1114404 / r1114416;
double r1114418 = r1114415 - r1114417;
double r1114419 = 1.0;
double r1114420 = r1114419 / r1114413;
double r1114421 = r1114404 * r1114403;
double r1114422 = r1114421 / r1114413;
double r1114423 = -r1114422;
double r1114424 = fma(r1114402, r1114420, r1114423);
double r1114425 = r1114412 ? r1114418 : r1114424;
return r1114425;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 7.3 |
|---|---|
| Target | 6.1 |
| Herbie | 0.6 |
if (- (* x y) (* z t)) < -inf.0 or 6.823892997990362e+254 < (- (* x y) (* z t)) Initial program 51.0
rmApplied div-sub51.1
Simplified51.1
rmApplied associate-/l*26.5
rmApplied associate-/l*0.3
if -inf.0 < (- (* x y) (* z t)) < 6.823892997990362e+254Initial program 0.7
rmApplied div-sub0.7
Simplified0.7
rmApplied div-inv0.7
Applied fma-neg0.7
Final simplification0.6
herbie shell --seed 2019362 +o rules:numerics
(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))