\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\begin{array}{l}
\mathbf{if}\;\left(\left(y \cdot 9\right) \cdot z\right) \cdot t \leq -2.9625710411553207 \cdot 10^{+307}:\\
\;\;\;\;\left(x \cdot 2 - z \cdot \left(9 \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;\left(\left(y \cdot 9\right) \cdot z\right) \cdot t \leq 1.010787557651193 \cdot 10^{+286}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
(FPCore (x y z t a b)
:precision binary64
(if (<= (* (* (* y 9.0) z) t) -2.9625710411553207e+307)
(+ (- (* x 2.0) (* z (* 9.0 (* y t)))) (* a (* 27.0 b)))
(if (<= (* (* (* y 9.0) z) t) 1.010787557651193e+286)
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* b (* a 27.0)))
(+ (* b (* a 27.0)) (- (* x 2.0) (* y (* 9.0 (* z t))))))))double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((y * 9.0) * z) * t) <= -2.9625710411553207e+307) {
tmp = ((x * 2.0) - (z * (9.0 * (y * t)))) + (a * (27.0 * b));
} else if ((((y * 9.0) * z) * t) <= 1.010787557651193e+286) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (b * (a * 27.0));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
}
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
Results
| Original | 3.0 |
|---|---|
| Target | 3.4 |
| Herbie | 0.7 |
if (*.f64 (*.f64 (*.f64 y 9) z) t) < -2.9625710411553207e307Initial program 62.7
rmApplied associate-*l*_binary644.3
Simplified4.3
rmApplied associate-*r*_binary643.5
Simplified3.5
rmApplied pow1_binary643.5
Applied pow1_binary643.5
Applied pow-prod-down_binary643.5
Applied pow1_binary643.5
Applied pow-prod-down_binary643.5
Simplified1.6
rmApplied associate-*l*_binary641.6
if -2.9625710411553207e307 < (*.f64 (*.f64 (*.f64 y 9) z) t) < 1.01078755765119304e286Initial program 0.5
rmApplied *-un-lft-identity_binary640.5
if 1.01078755765119304e286 < (*.f64 (*.f64 (*.f64 y 9) z) t) Initial program 41.3
rmApplied associate-*l*_binary645.4
Simplified5.4
rmApplied associate-*l*_binary644.5
Final simplification0.7
herbie shell --seed 2021118
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))