\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.7713669608055964 \cdot 10^{-119}:\\
\;\;\;\;\sqrt[3]{t \cdot \left(\left(x \cdot \left(18 \cdot y\right)\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)} \cdot \left(\sqrt[3]{t \cdot \left(\left(x \cdot \left(18 \cdot y\right)\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)} \cdot \sqrt[3]{t \cdot \left(\left(x \cdot \left(18 \cdot y\right)\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)}\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;t \leq 1.389098210761329 \cdot 10^{-101}:\\
\;\;\;\;\left(\left(b \cdot c + \left(\left(x \cdot 18\right) \cdot \left(y \cdot \left(t \cdot z\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;t \leq 1.178785463028594 \cdot 10^{-52}:\\
\;\;\;\;\left(\left(b \cdot c + \left(\left(x \cdot \left(18 \cdot y\right)\right) \cdot \left(t \cdot z\right) - t \cdot \left(a \cdot 4\right)\right)\right) - x \cdot \left(4 \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + \left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - \left(j \cdot 27\right) \cdot k\\
\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.7713669608055964e-119)
(-
(*
(cbrt
(+
(* t (- (* (* x (* 18.0 y)) z) (* a 4.0)))
(- (* b c) (* x (* 4.0 i)))))
(*
(cbrt
(+
(* t (- (* (* x (* 18.0 y)) z) (* a 4.0)))
(- (* b c) (* x (* 4.0 i)))))
(cbrt
(+
(* t (- (* (* x (* 18.0 y)) z) (* a 4.0)))
(- (* b c) (* x (* 4.0 i)))))))
(* (* j 27.0) k))
(if (<= t 1.389098210761329e-101)
(-
(-
(+ (* b c) (- (* (* x 18.0) (* y (* t z))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* (* j 27.0) k))
(if (<= t 1.178785463028594e-52)
(-
(-
(+ (* b c) (- (* (* x (* 18.0 y)) (* t z)) (* t (* a 4.0))))
(* x (* 4.0 i)))
(* (* j 27.0) k))
(-
(-
(+ (* b c) (- (* t (* (* x 18.0) (* y z))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* (* 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) {
return ((double) (((double) (((double) (((double) (((double) (((double) (((double) (((double) (x * 18.0)) * y)) * z)) * t)) - ((double) (((double) (a * 4.0)) * t)))) + ((double) (b * c)))) - ((double) (((double) (x * 4.0)) * i)))) - ((double) (((double) (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.7713669608055964e-119)) {
tmp = ((double) (((double) (((double) cbrt(((double) (((double) (t * ((double) (((double) (((double) (x * ((double) (18.0 * y)))) * z)) - ((double) (a * 4.0)))))) + ((double) (((double) (b * c)) - ((double) (x * ((double) (4.0 * i)))))))))) * ((double) (((double) cbrt(((double) (((double) (t * ((double) (((double) (((double) (x * ((double) (18.0 * y)))) * z)) - ((double) (a * 4.0)))))) + ((double) (((double) (b * c)) - ((double) (x * ((double) (4.0 * i)))))))))) * ((double) cbrt(((double) (((double) (t * ((double) (((double) (((double) (x * ((double) (18.0 * y)))) * z)) - ((double) (a * 4.0)))))) + ((double) (((double) (b * c)) - ((double) (x * ((double) (4.0 * i)))))))))))))) - ((double) (((double) (j * 27.0)) * k))));
} else {
double tmp_1;
if ((t <= 1.389098210761329e-101)) {
tmp_1 = ((double) (((double) (((double) (((double) (b * c)) + ((double) (((double) (((double) (x * 18.0)) * ((double) (y * ((double) (t * z)))))) - ((double) (t * ((double) (a * 4.0)))))))) - ((double) (i * ((double) (x * 4.0)))))) - ((double) (((double) (j * 27.0)) * k))));
} else {
double tmp_2;
if ((t <= 1.178785463028594e-52)) {
tmp_2 = ((double) (((double) (((double) (((double) (b * c)) + ((double) (((double) (((double) (x * ((double) (18.0 * y)))) * ((double) (t * z)))) - ((double) (t * ((double) (a * 4.0)))))))) - ((double) (x * ((double) (4.0 * i)))))) - ((double) (((double) (j * 27.0)) * k))));
} else {
tmp_2 = ((double) (((double) (((double) (((double) (b * c)) + ((double) (((double) (t * ((double) (((double) (x * 18.0)) * ((double) (y * z)))))) - ((double) (t * ((double) (a * 4.0)))))))) - ((double) (i * ((double) (x * 4.0)))))) - ((double) (((double) (j * 27.0)) * k))));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
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.4 |
|---|---|
| Target | 1.3 |
| Herbie | 2.4 |
if t < -1.7713669608055964e-119Initial program 3.0
rmApplied associate-*l*_binary647.3
rmApplied associate-*l*_binary647.4
rmApplied associate-*l*_binary647.4
rmApplied add-cube-cbrt_binary648.2
Simplified9.1
Simplified4.0
if -1.7713669608055964e-119 < t < 1.38909821076132898e-101Initial program 8.9
rmApplied associate-*l*_binary644.6
rmApplied associate-*l*_binary641.0
if 1.38909821076132898e-101 < t < 1.17878546302859394e-52Initial program 7.1
rmApplied associate-*l*_binary643.4
rmApplied associate-*l*_binary643.4
rmApplied associate-*l*_binary643.4
if 1.17878546302859394e-52 < t Initial program 2.0
rmApplied associate-*l*_binary642.6
Final simplification2.4
herbie shell --seed 2020205
(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)))