\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}\;t \le -1.4881373191208173 \cdot 10^{-165}:\\
\;\;\;\;\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{elif}\;t \le 1.7703922976991347 \cdot 10^{-113}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(\left(9 \cdot z\right) \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}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 VAR;
if ((t <= -1.4881373191208173e-165)) {
VAR = fma(2.0, x, ((27.0 * (a * b)) - (9.0 * (t * (z * y)))));
} else {
double VAR_1;
if ((t <= 1.7703922976991347e-113)) {
VAR_1 = fma(a, (27.0 * b), ((x * 2.0) - (y * ((9.0 * z) * t))));
} else {
VAR_1 = (((x * 2.0) - ((y * (9.0 * z)) * t)) + ((a * 27.0) * b));
}
VAR = VAR_1;
}
return VAR;
}




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.7 |
|---|---|
| Target | 2.7 |
| Herbie | 1.3 |
if t < -1.4881373191208173e-165Initial program 1.9
rmApplied associate-*l*4.7
Taylor expanded around inf 1.8
Simplified4.7
Taylor expanded around inf 1.8
Simplified1.8
if -1.4881373191208173e-165 < t < 1.7703922976991347e-113Initial program 7.9
rmApplied associate-*l*0.6
Taylor expanded around inf 7.8
Simplified0.6
rmApplied associate-*l*0.6
rmApplied associate-*r*0.8
if 1.7703922976991347e-113 < t Initial program 1.3
rmApplied associate-*l*1.3
Final simplification1.3
herbie shell --seed 2020079 +o rules:numerics
(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) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b)))
(+ (- (* x 2) (* (* (* y 9) z) t)) (* (* a 27) b)))