\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \le -4.33614598053493508 \cdot 10^{-182}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\frac{c}{a}}, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z \cdot c}\right)\\
\mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \le 9.7305668018081667 \cdot 10^{88}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \le 2.03675997192709853 \cdot 10^{307}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}double code(double x, double y, double z, double t, double a, double b, double c) {
return (((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
double temp;
if (((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -4.336145980534935e-182)) {
temp = fma(-4.0, (t / (c / a)), (fma(x, (9.0 * y), b) / (z * c)));
} else {
double temp_1;
if (((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= 9.730566801808167e+88)) {
temp_1 = fma(-4.0, ((t * a) / c), ((fma((9.0 * x), y, b) / z) / c));
} else {
double temp_2;
if (((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= 2.0367599719270985e+307)) {
temp_2 = (((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c));
} else {
temp_2 = (-4.0 * ((a * t) / c));
}
temp_1 = temp_2;
}
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
Results
| Original | 20.8 |
|---|---|
| Target | 14.5 |
| Herbie | 8.9 |
if (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < -4.336145980534935e-182Initial program 12.9
Simplified8.3
rmApplied associate-/l*7.3
if -4.336145980534935e-182 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 9.730566801808167e+88Initial program 14.9
Simplified9.7
rmApplied associate-/r*1.8
Simplified1.8
if 9.730566801808167e+88 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 2.0367599719270985e+307Initial program 0.6
if 2.0367599719270985e+307 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) Initial program 63.7
Simplified31.3
Taylor expanded around inf 30.3
Final simplification8.9
herbie shell --seed 2020049 +o rules:numerics
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -1.1001567408041051e-171) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -0.0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)))