\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}\;c \leq -2.5948083836392496 \cdot 10^{+243}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x \cdot y}{c \cdot z}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;c \leq -7.1508586972380935 \cdot 10^{+143}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{y \cdot \frac{x}{z}}{c}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;c \leq -2.7444922325717474 \cdot 10^{-13}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x}{\frac{z}{\frac{y}{c}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;c \leq 5.017340518112637 \cdot 10^{+97}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b + y \cdot \left(9 \cdot x\right)}{z} + a \cdot \left(t \cdot -4\right)}}\\
\mathbf{elif}\;c \leq 5.546949437242792 \cdot 10^{+124}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x \cdot y}{c \cdot z}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;c \leq 1.2353692371008664 \cdot 10^{+143}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{y \cdot \frac{x}{z}}{c}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;c \leq 1.8206532349167078 \cdot 10^{+266}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x}{\frac{z}{\frac{y}{c}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x \cdot y}{c \cdot z}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
(FPCore (x y z t a b c)
:precision binary64
(if (<= c -2.5948083836392496e+243)
(- (+ (/ b (* c z)) (* 9.0 (/ (* x y) (* c z)))) (* 4.0 (* a (/ t c))))
(if (<= c -7.1508586972380935e+143)
(- (+ (/ b (* c z)) (* 9.0 (/ (* y (/ x z)) c))) (* 4.0 (/ (* a t) c)))
(if (<= c -2.7444922325717474e-13)
(- (+ (/ b (* c z)) (* 9.0 (/ x (/ z (/ y c))))) (* 4.0 (/ (* a t) c)))
(if (<= c 5.017340518112637e+97)
(/ 1.0 (/ c (+ (/ (+ b (* y (* 9.0 x))) z) (* a (* t -4.0)))))
(if (<= c 5.546949437242792e+124)
(-
(+ (/ b (* c z)) (* 9.0 (/ (* x y) (* c z))))
(* 4.0 (* a (/ t c))))
(if (<= c 1.2353692371008664e+143)
(-
(+ (/ b (* c z)) (* 9.0 (/ (* y (/ x z)) c)))
(* 4.0 (/ (* a t) c)))
(if (<= c 1.8206532349167078e+266)
(-
(+ (/ b (* c z)) (* 9.0 (/ x (/ z (/ y c)))))
(* 4.0 (/ (* a t) c)))
(-
(+ (/ b (* c z)) (* 9.0 (/ (* x y) (* c z))))
(* 4.0 (* a (/ t c))))))))))))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 tmp;
if (c <= -2.5948083836392496e+243) {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (a * (t / c)));
} else if (c <= -7.1508586972380935e+143) {
tmp = ((b / (c * z)) + (9.0 * ((y * (x / z)) / c))) - (4.0 * ((a * t) / c));
} else if (c <= -2.7444922325717474e-13) {
tmp = ((b / (c * z)) + (9.0 * (x / (z / (y / c))))) - (4.0 * ((a * t) / c));
} else if (c <= 5.017340518112637e+97) {
tmp = 1.0 / (c / (((b + (y * (9.0 * x))) / z) + (a * (t * -4.0))));
} else if (c <= 5.546949437242792e+124) {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (a * (t / c)));
} else if (c <= 1.2353692371008664e+143) {
tmp = ((b / (c * z)) + (9.0 * ((y * (x / z)) / c))) - (4.0 * ((a * t) / c));
} else if (c <= 1.8206532349167078e+266) {
tmp = ((b / (c * z)) + (9.0 * (x / (z / (y / c))))) - (4.0 * ((a * t) / c));
} else {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (a * (t / c)));
}
return tmp;
}




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.3 |
|---|---|
| Target | 14.8 |
| Herbie | 10.3 |
if c < -2.5948083836392496e243 or 5.0173405181126369e97 < c < 5.54694943724279193e124 or 1.82065323491670777e266 < c Initial program 26.5
Simplified22.1
Taylor expanded around 0 18.8
Simplified18.8
rmApplied *-un-lft-identity_binary6418.8
Applied times-frac_binary6415.4
Simplified15.4
if -2.5948083836392496e243 < c < -7.1508586972380935e143 or 5.54694943724279193e124 < c < 1.2353692371008664e143Initial program 24.4
Simplified20.8
Taylor expanded around 0 17.7
Simplified17.7
rmApplied associate-/r*_binary6419.8
Simplified19.4
if -7.1508586972380935e143 < c < -2.7444922325717474e-13 or 1.2353692371008664e143 < c < 1.82065323491670777e266Initial program 22.2
Simplified17.5
Taylor expanded around 0 14.0
Simplified14.0
rmApplied associate-/l*_binary6412.3
Simplified10.6
if -2.7444922325717474e-13 < c < 5.0173405181126369e97Initial program 14.9
Simplified4.9
rmApplied clear-num_binary645.0
Final simplification10.3
herbie shell --seed 2020220
(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)))