\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 -1.990106932961341 \cdot 10^{-158}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;t \le 1.2973098851879563 \cdot 10^{-251}:\\
\;\;\;\;\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 1.76983793058826964 \cdot 10^{-210}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{\frac{a \cdot t}{\sqrt[3]{c} \cdot \sqrt[3]{c}}}{\sqrt[3]{c}}\\
\mathbf{elif}\;t \le 2.49531424624105425 \cdot 10^{-199}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\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 ((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 <= -1.990106932961341e-158)) {
VAR = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (x / ((double) (((double) (z * c)) / y)))))))) - ((double) (4.0 * ((double) (a / ((double) (c / t))))))));
} else {
double VAR_1;
if ((t <= 1.2973098851879563e-251)) {
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 <= 1.7698379305882696e-210)) {
VAR_2 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (((double) (x * y)) / ((double) (z * c)))))))) - ((double) (4.0 * ((double) (((double) (((double) (a * t)) / ((double) (((double) cbrt(c)) * ((double) cbrt(c)))))) / ((double) cbrt(c))))))));
} else {
double VAR_3;
if ((t <= 2.4953142462410543e-199)) {
VAR_3 = ((double) (((double) (((double) (((double) (((double) (((double) (x * 9.0)) * y)) - ((double) (((double) (((double) (z * 4.0)) * t)) * a)))) + b)) / z)) / c));
} else {
VAR_3 = ((double) (((double) (((double) (b / ((double) (z * c)))) + ((double) (9.0 * ((double) (((double) (x / z)) * ((double) (y / c)))))))) - ((double) (4.0 * ((double) (a / ((double) (c / t))))))));
}
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.5 |
|---|---|
| Target | 14.8 |
| Herbie | 10.7 |
if t < -1.990106932961341e-158Initial program 23.7
Taylor expanded around 0 12.8
rmApplied associate-/l*10.9
rmApplied associate-/l*9.3
if -1.990106932961341e-158 < t < 1.2973098851879563e-251 or 1.76983793058826964e-210 < t < 2.49531424624105425e-199Initial program 12.5
rmApplied associate-/r*11.1
if 1.2973098851879563e-251 < t < 1.76983793058826964e-210Initial program 13.4
Taylor expanded around 0 9.8
rmApplied add-cube-cbrt10.0
Applied associate-/r*10.0
if 2.49531424624105425e-199 < t Initial program 22.6
Taylor expanded around 0 12.2
rmApplied associate-/l*11.1
rmApplied times-frac11.8
Final simplification10.7
herbie shell --seed 2020171
(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)))