\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 -3.43065491529102247 \cdot 10^{-125}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{elif}\;t \le 7.162481485317363 \cdot 10^{-153}:\\
\;\;\;\;\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 3.4153001191145707 \cdot 10^{77}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\left(z \cdot c\right) \cdot \frac{1}{y}}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t \le 7.8318892149752565 \cdot 10^{225}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\left(z \cdot c\right) \cdot \frac{1}{y}}\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 ((t <= -3.4306549152910225e-125)) {
VAR = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (((double) (x * y)) / ((double) (z * c)))))))) - ((double) (4.0 * ((double) (((double) (a / c)) * t))))));
} else {
double VAR_1;
if ((t <= 7.162481485317363e-153)) {
VAR_1 = ((double) (((double) (((double) (((double) (((double) (((double) (x * 9.0)) * y)) - ((double) (((double) (((double) (z * 4.0)) * t)) * a)))) + b)) / z)) / c));
} else {
double VAR_2;
if ((t <= 3.4153001191145707e+77)) {
VAR_2 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (x / ((double) (((double) (z * c)) * ((double) (1.0 / y)))))))))) - ((double) (4.0 * ((double) (((double) (a * t)) / c))))));
} else {
double VAR_3;
if ((t <= 7.831889214975256e+225)) {
VAR_3 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (((double) (x * y)) / ((double) (z * c)))))))) - ((double) (4.0 * ((double) (((double) (a / c)) * t))))));
} else {
VAR_3 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (x / ((double) (((double) (z * c)) * ((double) (1.0 / y)))))))))) - ((double) (4.0 * ((double) (((double) (a * t)) / c))))));
}
VAR_2 = VAR_3;
}
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.2 |
|---|---|
| Target | 14.8 |
| Herbie | 10.5 |
if t < -3.43065491529102247e-125 or 3.4153001191145707e77 < t < 7.8318892149752565e225Initial program 25.5
Taylor expanded around 0 13.0
rmApplied associate-/l*9.9
rmApplied associate-/r/9.3
if -3.43065491529102247e-125 < t < 7.162481485317363e-153Initial program 12.6
rmApplied associate-/r*11.8
if 7.162481485317363e-153 < t < 3.4153001191145707e77 or 7.8318892149752565e225 < t Initial program 20.5
Taylor expanded around 0 11.6
rmApplied associate-/l*11.0
rmApplied div-inv11.0
Final simplification10.5
herbie shell --seed 2020175
(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)))