\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}\;t \le -6.36732518833848025 \cdot 10^{-192}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{1}{z} \cdot \frac{x}{\frac{c}{y}}\right)\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;t \le 3.507527873864621 \cdot 10^{-285}:\\
\;\;\;\;\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}\\
\mathbf{elif}\;t \le 7.9555437739864164 \cdot 10^{-71}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z \cdot c} \cdot y\right)\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;t \le 2.24947951631066874 \cdot 10^{61}:\\
\;\;\;\;\left(\frac{\sqrt[3]{b} \cdot \sqrt[3]{b}}{z} \cdot \frac{\sqrt[3]{b}}{c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{1}{z} \cdot \frac{x}{\frac{c}{y}}\right)\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 ((t <= -6.36732518833848e-192)) {
temp = (((b / (z * c)) + (9.0 * ((1.0 / z) * (x / (c / y))))) - (4.0 * (a * (t / c))));
} else {
double temp_1;
if ((t <= 3.507527873864621e-285)) {
temp_1 = ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / z) / c);
} else {
double temp_2;
if ((t <= 7.955543773986416e-71)) {
temp_2 = (((b / (z * c)) + (9.0 * ((x / (z * c)) * y))) - (4.0 * (a * (t / c))));
} else {
double temp_3;
if ((t <= 2.2494795163106687e+61)) {
temp_3 = (((((cbrt(b) * cbrt(b)) / z) * (cbrt(b) / c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((a * t) / c)));
} else {
temp_3 = (((b / (z * c)) + (9.0 * ((1.0 / z) * (x / (c / y))))) - (4.0 * (a * (t / c))));
}
temp_2 = temp_3;
}
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.9 |
| Herbie | 10.8 |
if t < -6.36732518833848e-192 or 2.2494795163106687e+61 < t Initial program 25.4
Taylor expanded around 0 14.0
rmApplied *-un-lft-identity14.0
Applied times-frac11.7
Simplified11.7
rmApplied associate-/l*9.7
rmApplied *-un-lft-identity9.7
Applied times-frac10.0
Applied *-un-lft-identity10.0
Applied times-frac10.6
Simplified10.6
if -6.36732518833848e-192 < t < 3.507527873864621e-285Initial program 12.6
rmApplied associate-/r*10.9
if 3.507527873864621e-285 < t < 7.955543773986416e-71Initial program 13.7
Taylor expanded around 0 10.1
rmApplied *-un-lft-identity10.1
Applied times-frac12.2
Simplified12.2
rmApplied associate-/l*11.4
rmApplied associate-/r/12.2
if 7.955543773986416e-71 < t < 2.2494795163106687e+61Initial program 18.8
Taylor expanded around 0 9.6
rmApplied add-cube-cbrt9.9
Applied times-frac9.5
Final simplification10.8
herbie shell --seed 2020060
(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)))