\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}\;z \le -1.38861379515310713 \cdot 10^{202}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{1}{\frac{y}{z \cdot c}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;z \le -2.97485279857690535 \cdot 10^{-36}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;z \le 16984239336819632:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{1}{\frac{y}{z \cdot c}}}\right) - 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 ((double) (((double) (((double) (((double) (((double) (x * 9.0)) * y)) - ((double) (((double) (((double) (z * 4.0)) * t)) * a)))) + b)) / ((double) (z * c))));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
double VAR;
if ((z <= -1.3886137951531071e+202)) {
VAR = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (x / ((double) (1.0 / ((double) (y / ((double) (z * c)))))))))))) - ((double) (4.0 * ((double) (((double) (a * t)) / c))))));
} else {
double VAR_1;
if ((z <= -2.9748527985769054e-36)) {
VAR_1 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (((double) (x / z)) * ((double) (y / c)))))))) - ((double) (4.0 * ((double) (a / ((double) (c / t))))))));
} else {
double VAR_2;
if ((z <= 16984239336819632.0)) {
VAR_2 = ((double) (((double) (1.0 / z)) * ((double) (((double) (((double) (((double) (((double) (x * 9.0)) * y)) - ((double) (((double) (((double) (z * 4.0)) * t)) * a)))) + b)) / c))));
} else {
VAR_2 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (x / ((double) (1.0 / ((double) (y / ((double) (z * c)))))))))))) - ((double) (4.0 * ((double) (((double) (a * t)) / c))))));
}
VAR_1 = VAR_2;
}
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




Bits error versus c
Results
| Original | 20.7 |
|---|---|
| Target | 14.7 |
| Herbie | 9.1 |
if z < -1.3886137951531071e+202 or 16984239336819632.0 < z Initial program 33.0
Taylor expanded around 0 13.7
rmApplied associate-/l*11.6
rmApplied clear-num11.6
if -1.3886137951531071e+202 < z < -2.9748527985769054e-36Initial program 21.6
Taylor expanded around 0 12.1
rmApplied associate-/l*11.7
rmApplied times-frac8.8
if -2.9748527985769054e-36 < z < 16984239336819632.0Initial program 7.0
rmApplied *-un-lft-identity7.0
Applied times-frac6.6
Final simplification9.1
herbie shell --seed 2020148
(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.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.1001567408041051e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))