\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}\;x \leq -7.14462332976739 \cdot 10^{-22} \lor \neg \left(x \leq 1.8467307309333337 \cdot 10^{-43}\right):\\
\;\;\;\;x \cdot \left(y \cdot \left(18 \cdot \left(z \cdot t\right)\right)\right) + \left(b \cdot c - \left(j \cdot \left(27 \cdot k\right) + 4 \cdot \left(t \cdot a + x \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - \left(j \cdot \left(27 \cdot k\right) + 4 \cdot \left(t \cdot a + x \cdot i\right)\right)\right) + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\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 (or (<= x -7.14462332976739e-22) (not (<= x 1.8467307309333337e-43)))
(+
(* x (* y (* 18.0 (* z t))))
(- (* b c) (+ (* j (* 27.0 k)) (* 4.0 (+ (* t a) (* x i))))))
(+
(- (* b c) (+ (* j (* 27.0 k)) (* 4.0 (+ (* t a) (* x i)))))
(* t (* 18.0 (* y (* x z)))))))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 (((x <= -7.14462332976739e-22) || !(x <= 1.8467307309333337e-43))) {
tmp = ((double) (((double) (x * ((double) (y * ((double) (18.0 * ((double) (z * t)))))))) + ((double) (((double) (b * c)) - ((double) (((double) (j * ((double) (27.0 * k)))) + ((double) (4.0 * ((double) (((double) (t * a)) + ((double) (x * i))))))))))));
} else {
tmp = ((double) (((double) (((double) (b * c)) - ((double) (((double) (j * ((double) (27.0 * k)))) + ((double) (4.0 * ((double) (((double) (t * a)) + ((double) (x * i)))))))))) + ((double) (t * ((double) (18.0 * ((double) (y * ((double) (x * z))))))))));
}
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.7 |
|---|---|
| Target | 1.7 |
| Herbie | 1.6 |
if x < -7.1446233297673901e-22 or 1.84673073093333372e-43 < x Initial program Error: 11.3 bits
SimplifiedError: 2.0 bits
Taylor expanded around inf Error: 2.3 bits
SimplifiedError: 2.0 bits
if -7.1446233297673901e-22 < x < 1.84673073093333372e-43Initial program Error: 1.3 bits
SimplifiedError: 8.5 bits
Taylor expanded around inf Error: 5.8 bits
SimplifiedError: 1.3 bits
Final simplificationError: 1.6 bits
herbie shell --seed 2020203
(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)))