\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\begin{array}{l}
\mathbf{if}\;t \leq -1.745359137870568 \cdot 10^{-61}:\\
\;\;\;\;t \cdot \left(\left(x \cdot 18\right) \cdot \left(z \cdot y\right) - a \cdot 4\right) + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)\\
\mathbf{elif}\;t \leq 1.2678624417890926 \cdot 10^{-154}:\\
\;\;\;\;\left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) + -4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(\left(x \cdot 18\right) \cdot y\right) - a \cdot 4\right) + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + 27 \cdot \left(j \cdot k\right)\right)\right)\\
\end{array}(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= t -1.745359137870568e-61)
(+
(* t (- (* (* x 18.0) (* z y)) (* a 4.0)))
(- (* b c) (+ (* (* x 4.0) i) (* (* j 27.0) k))))
(if (<= t 1.2678624417890926e-154)
(+ (- (* b c) (+ (* (* x 4.0) i) (* (* j 27.0) k))) (* -4.0 (* t a)))
(+
(* t (- (* z (* (* x 18.0) y)) (* a 4.0)))
(- (* b c) (+ (* (* x 4.0) i) (* 27.0 (* j k))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (t <= -1.745359137870568e-61) {
tmp = (t * (((x * 18.0) * (z * y)) - (a * 4.0))) + ((b * c) - (((x * 4.0) * i) + ((j * 27.0) * k)));
} else if (t <= 1.2678624417890926e-154) {
tmp = ((b * c) - (((x * 4.0) * i) + ((j * 27.0) * k))) + (-4.0 * (t * a));
} else {
tmp = (t * ((z * ((x * 18.0) * y)) - (a * 4.0))) + ((b * c) - (((x * 4.0) * i) + (27.0 * (j * k))));
}
return tmp;
}




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




Bits error versus k
Results
| Original | 5.2 |
|---|---|
| Target | 1.6 |
| Herbie | 4.6 |
if t < -1.7453591378705681e-61Initial program 2.1
Simplified2.1
rmApplied associate-*l*_binary64_197972.4
Simplified2.4
if -1.7453591378705681e-61 < t < 1.26786244178909264e-154Initial program 8.4
Simplified8.4
Taylor expanded around 0 6.8
Simplified6.8
if 1.26786244178909264e-154 < t Initial program 3.5
Simplified3.5
Taylor expanded around 0 3.5
Final simplification4.6
herbie shell --seed 2021043
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:herbie-target
(if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))