\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.08086180327997525 \cdot 10^{240}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\right) - 4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 6.28557105386542453 \cdot 10^{251}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + \left(9 \cdot \frac{x}{z}\right) \cdot \frac{y}{c}\right) - 4 \cdot \frac{a}{\frac{c}{t}}\\
\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 ((((x * 9.0) * y) <= -1.0808618032799752e+240)) {
temp = (((b / (z * c)) + (9.0 * (x / (z * (c / y))))) - (4.0 * (a / (c / t))));
} else {
double temp_1;
if ((((x * 9.0) * y) <= 6.285571053865425e+251)) {
temp_1 = (((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * (a * (t / c))));
} else {
temp_1 = (((b / (z * c)) + ((9.0 * (x / z)) * (y / c))) - (4.0 * (a / (c / t))));
}
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.1 |
|---|---|
| Target | 14.6 |
| Herbie | 7.2 |
if (* (* x 9.0) y) < -1.0808618032799752e+240Initial program 46.1
Taylor expanded around 0 42.2
rmApplied associate-/l*40.0
rmApplied associate-/l*16.8
rmApplied *-un-lft-identity16.8
Applied times-frac6.5
Simplified6.5
if -1.0808618032799752e+240 < (* (* x 9.0) y) < 6.285571053865425e+251Initial program 16.5
Taylor expanded around 0 7.9
rmApplied *-un-lft-identity7.9
Applied times-frac7.0
Simplified7.0
if 6.285571053865425e+251 < (* (* x 9.0) y) Initial program 49.0
Taylor expanded around 0 43.9
rmApplied associate-/l*42.4
rmApplied times-frac10.6
Applied associate-*r*10.7
Final simplification7.2
herbie shell --seed 2020058
(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)))