\frac{x \cdot y - z \cdot t}{a}\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty \lor \neg \left(z \cdot t \leq -7.07108368946119 \cdot 10^{-71} \lor \neg \left(z \cdot t \leq 5.093405697431204 \cdot 10^{-195}\right) \land z \cdot t \leq 8.389003426116215 \cdot 10^{+177}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - z \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{a} - \frac{z \cdot t}{a}\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
(FPCore (x y z t a)
:precision binary64
(if (or (<= (* z t) (- INFINITY))
(not
(or (<= (* z t) -7.07108368946119e-71)
(and (not (<= (* z t) 5.093405697431204e-195))
(<= (* z t) 8.389003426116215e+177)))))
(- (* x (/ y a)) (* z (/ t a)))
(- (* (* x (* (cbrt y) (cbrt y))) (/ (cbrt y) a)) (/ (* z t) a))))double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z * t) <= -((double) INFINITY)) || !(((z * t) <= -7.07108368946119e-71) || (!((z * t) <= 5.093405697431204e-195) && ((z * t) <= 8.389003426116215e+177)))) {
tmp = (x * (y / a)) - (z * (t / a));
} else {
tmp = ((x * (cbrt(y) * cbrt(y))) * (cbrt(y) / a)) - ((z * t) / a);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 7.5 |
|---|---|
| Target | 6.1 |
| Herbie | 4.2 |
if (*.f64 z t) < -inf.0 or -7.0710836894611897e-71 < (*.f64 z t) < 5.09340569743120393e-195 or 8.38900342611621471e177 < (*.f64 z t) Initial program 11.5
rmApplied div-sub_binary6411.5
rmApplied *-un-lft-identity_binary6411.5
Applied times-frac_binary6412.6
Simplified12.6
rmApplied *-un-lft-identity_binary6412.6
Applied times-frac_binary645.3
Simplified5.3
if -inf.0 < (*.f64 z t) < -7.0710836894611897e-71 or 5.09340569743120393e-195 < (*.f64 z t) < 8.38900342611621471e177Initial program 3.9
rmApplied div-sub_binary643.9
rmApplied *-un-lft-identity_binary643.9
Applied times-frac_binary644.0
Simplified4.0
rmApplied *-un-lft-identity_binary644.0
Applied add-cube-cbrt_binary644.4
Applied times-frac_binary644.4
Applied associate-*r*_binary643.2
Simplified3.2
Final simplification4.2
herbie shell --seed 2020219
(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))