\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le -2.829533880468204293018311062466912085651 \cdot 10^{150}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{a}, -z \cdot \frac{t}{a}\right) + \mathsf{fma}\left(-\frac{t}{a}, z, z \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;x \cdot y - z \cdot t \le 2.560348681674806982161079926590341946882 \cdot 10^{214}:\\
\;\;\;\;\left(\sqrt[3]{x \cdot y - z \cdot t} \cdot \sqrt[3]{x \cdot y - z \cdot t}\right) \cdot \frac{\sqrt[3]{x \cdot y - z \cdot t}}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{a}, -z \cdot \frac{t}{a}\right) + \mathsf{fma}\left(-\frac{t}{a}, z, z \cdot \frac{t}{a}\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r198633761 = x;
double r198633762 = y;
double r198633763 = r198633761 * r198633762;
double r198633764 = z;
double r198633765 = t;
double r198633766 = r198633764 * r198633765;
double r198633767 = r198633763 - r198633766;
double r198633768 = a;
double r198633769 = r198633767 / r198633768;
return r198633769;
}
double f(double x, double y, double z, double t, double a) {
double r198633770 = x;
double r198633771 = y;
double r198633772 = r198633770 * r198633771;
double r198633773 = z;
double r198633774 = t;
double r198633775 = r198633773 * r198633774;
double r198633776 = r198633772 - r198633775;
double r198633777 = -2.8295338804682043e+150;
bool r198633778 = r198633776 <= r198633777;
double r198633779 = a;
double r198633780 = r198633771 / r198633779;
double r198633781 = r198633774 / r198633779;
double r198633782 = r198633773 * r198633781;
double r198633783 = -r198633782;
double r198633784 = fma(r198633770, r198633780, r198633783);
double r198633785 = -r198633781;
double r198633786 = fma(r198633785, r198633773, r198633782);
double r198633787 = r198633784 + r198633786;
double r198633788 = 2.560348681674807e+214;
bool r198633789 = r198633776 <= r198633788;
double r198633790 = cbrt(r198633776);
double r198633791 = r198633790 * r198633790;
double r198633792 = r198633790 / r198633779;
double r198633793 = r198633791 * r198633792;
double r198633794 = r198633789 ? r198633793 : r198633787;
double r198633795 = r198633778 ? r198633787 : r198633794;
return r198633795;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 7.7 |
|---|---|
| Target | 6.0 |
| Herbie | 1.8 |
if (- (* x y) (* z t)) < -2.8295338804682043e+150 or 2.560348681674807e+214 < (- (* x y) (* z t)) Initial program 25.2
rmApplied div-sub25.2
rmApplied *-un-lft-identity25.2
Applied times-frac14.5
Applied *-un-lft-identity14.5
Applied times-frac1.6
Applied prod-diff1.6
if -2.8295338804682043e+150 < (- (* x y) (* z t)) < 2.560348681674807e+214Initial program 1.0
rmApplied *-un-lft-identity1.0
Applied add-cube-cbrt1.9
Applied times-frac1.9
Simplified1.9
Final simplification1.8
herbie shell --seed 2019173 +o rules:numerics
(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))