\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 \le -2.05110049757782854 \cdot 10^{65}:\\
\;\;\;\;\left(\left(\left(\left(x \cdot \left(\left(18 \cdot y\right) \cdot z\right)\right) \cdot t - a \cdot \left(4 \cdot t\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;t \le 3.21315296623720254 \cdot 10^{-90}:\\
\;\;\;\;\left(\left(\left(\left(x \cdot \left(18 \cdot y\right)\right) \cdot \left(z \cdot t\right) - a \cdot \left(4 \cdot t\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(x \cdot \left(18 \cdot y\right)\right) \cdot z\right) \cdot t - a \cdot \left(4 \cdot t\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(27 \cdot k\right)\\
\end{array}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 temp;
if ((t <= -2.0511004975778285e+65)) {
temp = ((((((x * ((18.0 * y) * z)) * t) - (a * (4.0 * t))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k));
} else {
double temp_1;
if ((t <= 3.2131529662372025e-90)) {
temp_1 = ((((((x * (18.0 * y)) * (z * t)) - (a * (4.0 * t))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k));
} else {
temp_1 = (((((((x * (18.0 * y)) * z) * t) - (a * (4.0 * t))) + (b * c)) - ((x * 4.0) * i)) - (j * (27.0 * k)));
}
temp = temp_1;
}
return temp;
}




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.1 |
|---|---|
| Target | 1.4 |
| Herbie | 3.5 |
if t < -2.0511004975778285e+65Initial program 1.2
rmApplied associate-*l*1.2
rmApplied associate-*l*1.4
rmApplied associate-*l*1.9
if -2.0511004975778285e+65 < t < 3.2131529662372025e-90Initial program 7.0
rmApplied associate-*l*7.0
rmApplied associate-*l*7.0
rmApplied associate-*l*4.2
if 3.2131529662372025e-90 < t Initial program 2.7
rmApplied associate-*l*2.7
rmApplied associate-*l*2.8
rmApplied associate-*l*2.7
Final simplification3.5
herbie shell --seed 2020060
(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 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b)))))
(- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))