\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 -5.9003598243494093 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(-4, t \cdot \frac{a}{c}, \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z \cdot c}\right)\\
\mathbf{elif}\;t \le -2.292107290191715 \cdot 10^{-283}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{1}{z} \cdot \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c}\right)\\
\mathbf{elif}\;t \le 1.84617460587888084 \cdot 10^{-219}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{z \cdot c}, \frac{b}{z \cdot c}\right)\right)\\
\mathbf{elif}\;t \le 1.34150248531036418 \cdot 10^{-50}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{1}{z} \cdot \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{\frac{t}{c}}{\frac{1}{a}}, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z \cdot 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 ((t <= -5.900359824349409e-28)) {
VAR = ((double) fma(((double) -(4.0)), ((double) (t * ((double) (a / c)))), ((double) (((double) fma(((double) (9.0 * x)), y, b)) / ((double) (z * c))))));
} else {
double VAR_1;
if ((t <= -2.292107290191715e-283)) {
VAR_1 = ((double) fma(((double) -(4.0)), ((double) (((double) (t * a)) / c)), ((double) (((double) (1.0 / z)) * ((double) (((double) fma(((double) (9.0 * x)), y, b)) / c))))));
} else {
double VAR_2;
if ((t <= 1.8461746058788808e-219)) {
VAR_2 = ((double) fma(((double) -(4.0)), ((double) (((double) (t * a)) / c)), ((double) fma(9.0, ((double) (((double) (x * y)) / ((double) (z * c)))), ((double) (b / ((double) (z * c))))))));
} else {
double VAR_3;
if ((t <= 1.3415024853103642e-50)) {
VAR_3 = ((double) fma(((double) -(4.0)), ((double) (((double) (t * a)) / c)), ((double) (((double) (1.0 / z)) * ((double) (((double) fma(((double) (9.0 * x)), y, b)) / c))))));
} else {
VAR_3 = ((double) fma(((double) -(4.0)), ((double) (((double) (t / c)) / ((double) (1.0 / a)))), ((double) (((double) fma(x, ((double) (9.0 * y)), b)) / ((double) (z * 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.6 |
|---|---|
| Target | 14.1 |
| Herbie | 10.2 |
if t < -5.900359824349409e-28Initial program 27.8
Simplified14.4
rmApplied *-un-lft-identity14.4
Applied times-frac10.0
Simplified10.0
Taylor expanded around 0 9.9
Simplified9.9
if -5.900359824349409e-28 < t < -2.292107290191715e-283 or 1.8461746058788808e-219 < t < 1.3415024853103642e-50Initial program 14.4
Simplified9.3
rmApplied *-un-lft-identity9.3
Applied times-frac10.6
Simplified10.6
if -2.292107290191715e-283 < t < 1.8461746058788808e-219Initial program 11.9
Simplified9.9
Taylor expanded around 0 9.7
Simplified9.7
if 1.3415024853103642e-50 < t Initial program 26.6
Simplified13.2
rmApplied associate-/l*9.7
rmApplied div-inv9.7
Applied associate-/r*10.2
Final simplification10.2
herbie shell --seed 2020123 +o rules:numerics
(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)))