\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 -4.4627057489340555 \cdot 10^{-108}:\\
\;\;\;\;\left(\frac{\sqrt[3]{b} \cdot \sqrt[3]{b}}{z} \cdot \frac{\sqrt[3]{b}}{c} + 9 \cdot \frac{1}{\frac{\frac{z \cdot c}{y}}{x}}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;z \le 2.29026724389609061 \cdot 10^{-68}:\\
\;\;\;\;\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{elif}\;z \le 2.90195016732761552 \cdot 10^{126}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{1}{\frac{\frac{z \cdot c}{y}}{x}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{1}{\frac{z \cdot \frac{c}{y}}{x}}\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 (((((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 VAR;
if ((z <= -4.4627057489340555e-108)) {
VAR = (((((cbrt(b) * cbrt(b)) / z) * (cbrt(b) / c)) + (9.0 * (1.0 / (((z * c) / y) / x)))) - (4.0 * ((a * t) / c)));
} else {
double VAR_1;
if ((z <= 2.2902672438960906e-68)) {
VAR_1 = ((1.0 / z) * (((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / c));
} else {
double VAR_2;
if ((z <= 2.9019501673276155e+126)) {
VAR_2 = (((b / (z * c)) + (9.0 * (1.0 / (((z * c) / y) / x)))) - (4.0 * (a * (t / c))));
} else {
VAR_2 = (((b / (z * c)) + (9.0 * (1.0 / ((z * (c / y)) / x)))) - (4.0 * ((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.5 |
| Herbie | 8.9 |
if z < -4.4627057489340555e-108Initial program 25.3
Taylor expanded around 0 12.4
rmApplied associate-/l*10.8
rmApplied clear-num10.8
rmApplied add-cube-cbrt11.0
Applied times-frac9.3
if -4.4627057489340555e-108 < z < 2.2902672438960906e-68Initial program 6.0
rmApplied *-un-lft-identity6.0
Applied times-frac6.0
if 2.2902672438960906e-68 < z < 2.9019501673276155e+126Initial program 14.6
Taylor expanded around 0 10.1
rmApplied associate-/l*9.0
rmApplied clear-num9.0
rmApplied *-un-lft-identity9.0
Applied times-frac8.9
Simplified8.9
if 2.9019501673276155e+126 < z Initial program 37.2
Taylor expanded around 0 15.3
rmApplied associate-/l*12.7
rmApplied clear-num12.7
rmApplied *-un-lft-identity12.7
Applied times-frac12.3
Simplified12.3
Final simplification8.9
herbie shell --seed 2020078
(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)))