\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.3306119810443409 \cdot 10^{259}:\\
\;\;\;\;\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.3042704372098045 \cdot 10^{158}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{1}{\frac{c}{a \cdot 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 ((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 ((((double) (((double) (x * 9.0)) * y)) <= -1.3306119810443409e+259)) {
VAR = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (((double) (9.0 * ((double) (x / z)))) * ((double) (y / c)))))) - ((double) (4.0 * ((double) (((double) (a * t)) / c))))));
} else {
double VAR_1;
if ((((double) (((double) (x * 9.0)) * y)) <= 3.3042704372098045e+158)) {
VAR_1 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (((double) (x * y)) / ((double) (z * c)))))))) - ((double) (4.0 * ((double) (1.0 / ((double) (c / ((double) (a * t))))))))));
} else {
VAR_1 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (x / ((double) (z * ((double) (c / y)))))))))) - ((double) (4.0 * ((double) (a * ((double) (t / c))))))));
}
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.8 |
|---|---|
| Target | 15.2 |
| Herbie | 8.3 |
if (* (* x 9.0) y) < -1.3306119810443409e259Initial program 50.4
Taylor expanded around 0 46.6
rmApplied times-frac13.5
Applied associate-*r*13.5
if -1.3306119810443409e259 < (* (* x 9.0) y) < 3.3042704372098045e158Initial program 17.1
Taylor expanded around 0 7.8
rmApplied clear-num7.9
if 3.3042704372098045e158 < (* (* x 9.0) y) Initial program 36.9
Taylor expanded around 0 30.4
rmApplied associate-/l*17.7
rmApplied *-un-lft-identity17.7
Applied times-frac13.6
Simplified13.6
rmApplied *-un-lft-identity13.6
Applied times-frac9.4
Simplified9.4
Final simplification8.3
herbie shell --seed 2020162
(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)))