\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\begin{array}{l}
\mathbf{if}\;b \le -8.311437424410602968393294732626591381699 \cdot 10^{-187}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(a \cdot \left(j \cdot c\right) + 1 \cdot \left(-1 \cdot \left(\left(i \cdot j\right) \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \le -6.469196241460224510801417511235181480356 \cdot 10^{-289}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - 0\right) + \left(a \cdot \left(j \cdot c\right) + 1 \cdot \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\right)\right)\\
\mathbf{elif}\;b \le 2.701853472416222263113483854524259515545 \cdot 10^{-61}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(a \cdot j\right) \cdot c + 1 \cdot \left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(a \cdot \left(j \cdot c\right) + 1 \cdot \left(-1 \cdot \left(\left(i \cdot j\right) \cdot y\right)\right)\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double r821164 = x;
double r821165 = y;
double r821166 = z;
double r821167 = r821165 * r821166;
double r821168 = t;
double r821169 = a;
double r821170 = r821168 * r821169;
double r821171 = r821167 - r821170;
double r821172 = r821164 * r821171;
double r821173 = b;
double r821174 = c;
double r821175 = r821174 * r821166;
double r821176 = i;
double r821177 = r821168 * r821176;
double r821178 = r821175 - r821177;
double r821179 = r821173 * r821178;
double r821180 = r821172 - r821179;
double r821181 = j;
double r821182 = r821174 * r821169;
double r821183 = r821165 * r821176;
double r821184 = r821182 - r821183;
double r821185 = r821181 * r821184;
double r821186 = r821180 + r821185;
return r821186;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double r821187 = b;
double r821188 = -8.311437424410603e-187;
bool r821189 = r821187 <= r821188;
double r821190 = x;
double r821191 = y;
double r821192 = z;
double r821193 = r821191 * r821192;
double r821194 = t;
double r821195 = a;
double r821196 = r821194 * r821195;
double r821197 = r821193 - r821196;
double r821198 = r821190 * r821197;
double r821199 = c;
double r821200 = r821199 * r821192;
double r821201 = i;
double r821202 = r821194 * r821201;
double r821203 = r821200 - r821202;
double r821204 = r821187 * r821203;
double r821205 = r821198 - r821204;
double r821206 = j;
double r821207 = r821206 * r821199;
double r821208 = r821195 * r821207;
double r821209 = 1.0;
double r821210 = -1.0;
double r821211 = r821201 * r821206;
double r821212 = r821211 * r821191;
double r821213 = r821210 * r821212;
double r821214 = r821209 * r821213;
double r821215 = r821208 + r821214;
double r821216 = r821205 + r821215;
double r821217 = -6.4691962414602245e-289;
bool r821218 = r821187 <= r821217;
double r821219 = 0.0;
double r821220 = r821198 - r821219;
double r821221 = r821206 * r821191;
double r821222 = r821201 * r821221;
double r821223 = r821210 * r821222;
double r821224 = r821209 * r821223;
double r821225 = r821208 + r821224;
double r821226 = r821220 + r821225;
double r821227 = 2.7018534724162223e-61;
bool r821228 = r821187 <= r821227;
double r821229 = r821195 * r821206;
double r821230 = r821229 * r821199;
double r821231 = r821230 + r821224;
double r821232 = r821205 + r821231;
double r821233 = r821228 ? r821232 : r821216;
double r821234 = r821218 ? r821226 : r821233;
double r821235 = r821189 ? r821216 : r821234;
return r821235;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus i




Bits error versus j
Results
| Original | 11.9 |
|---|---|
| Target | 20.0 |
| Herbie | 12.2 |
if b < -8.311437424410603e-187 or 2.7018534724162223e-61 < b Initial program 9.1
rmApplied add-cube-cbrt9.3
Applied associate-*l*9.3
rmApplied sub-neg9.3
Applied distribute-lft-in9.3
Applied distribute-lft-in9.3
Simplified9.7
Simplified9.6
rmApplied *-un-lft-identity9.6
Applied associate-*l*9.6
Simplified9.3
rmApplied associate-*r*9.5
if -8.311437424410603e-187 < b < -6.4691962414602245e-289Initial program 17.1
rmApplied add-cube-cbrt17.5
Applied associate-*l*17.5
rmApplied sub-neg17.5
Applied distribute-lft-in17.5
Applied distribute-lft-in17.5
Simplified18.3
Simplified18.1
rmApplied *-un-lft-identity18.1
Applied associate-*l*18.1
Simplified17.5
Taylor expanded around 0 17.1
if -6.4691962414602245e-289 < b < 2.7018534724162223e-61Initial program 16.5
rmApplied add-cube-cbrt16.9
Applied associate-*l*16.9
rmApplied sub-neg16.9
Applied distribute-lft-in16.9
Applied distribute-lft-in16.9
Simplified17.7
Simplified17.5
rmApplied *-un-lft-identity17.5
Applied associate-*l*17.5
Simplified17.2
rmApplied associate-*r*16.6
Final simplification12.2
herbie shell --seed 2019354
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:herbie-target
(if (< x -1.469694296777705e-64) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 3.2113527362226803e-147) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))