\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}\;\left(x \cdot 9\right) \cdot y \le -1.5066199414923813 \cdot 10^{253}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + \left(9 \cdot \frac{x}{z}\right) \cdot \frac{y}{c}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 3.70325944561656054 \cdot 10^{42}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\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) <= -1.5066199414923813e+253)) {
temp = (((b / (z * c)) + ((9.0 * (x / z)) * (y / c))) - (4.0 * ((a * t) / c)));
} else {
double temp_1;
if ((((x * 9.0) * y) <= 3.7032594456165605e+42)) {
temp_1 = (((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * (a / (c / t))));
} else {
temp_1 = (((b / (z * c)) + (9.0 * (x / (z * (c / y))))) - (4.0 * (a * (t / c))));
}
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.9 |
| Herbie | 8.5 |
if (* (* x 9.0) y) < -1.5066199414923813e+253Initial program 52.3
Taylor expanded around 0 49.5
rmApplied times-frac14.4
Applied associate-*r*14.6
if -1.5066199414923813e+253 < (* (* x 9.0) y) < 3.7032594456165605e+42Initial program 17.1
Taylor expanded around 0 7.5
rmApplied associate-/l*7.4
if 3.7032594456165605e+42 < (* (* x 9.0) y) Initial program 27.6
Taylor expanded around 0 20.8
rmApplied *-un-lft-identity20.8
Applied times-frac19.0
Simplified19.0
rmApplied associate-/l*13.4
rmApplied *-un-lft-identity13.4
Applied times-frac11.8
Simplified11.8
Final simplification8.5
herbie shell --seed 2020057
(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)))