\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 \le -3.71250790597694037 \cdot 10^{58}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{a}{\sqrt[3]{c}}, \frac{1}{z} \cdot \mathsf{fma}\left(9, x \cdot \frac{y}{c}, \frac{b}{c}\right)\right)\\
\mathbf{elif}\;c \le 2.9909017744909091 \cdot 10^{25}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{a}{\sqrt[3]{c}}, \frac{1}{z} \cdot \mathsf{fma}\left(9, \frac{x}{\frac{c}{y}}, \frac{b}{c}\right)\right)\\
\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 VAR;
if ((c <= -3.7125079059769404e+58)) {
VAR = fma(-4.0, ((t / (cbrt(c) * cbrt(c))) * (a / cbrt(c))), ((1.0 / z) * fma(9.0, (x * (y / c)), (b / c))));
} else {
double VAR_1;
if ((c <= 2.990901774490909e+25)) {
VAR_1 = fma(-4.0, ((t * a) / c), ((fma((9.0 * x), y, b) / z) / c));
} else {
VAR_1 = fma(-4.0, ((t / (cbrt(c) * cbrt(c))) * (a / cbrt(c))), ((1.0 / z) * fma(9.0, (x / (c / y)), (b / 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.7 |
|---|---|
| Target | 14.4 |
| Herbie | 4.7 |
if c < -3.7125079059769404e+58Initial program 24.1
Simplified16.7
rmApplied add-cube-cbrt17.0
Applied times-frac12.1
rmApplied *-un-lft-identity12.1
Applied times-frac9.1
Taylor expanded around 0 9.0
Simplified9.0
rmApplied *-un-lft-identity9.0
Applied times-frac5.8
Simplified5.8
if -3.7125079059769404e+58 < c < 2.990901774490909e+25Initial program 14.9
Simplified5.1
rmApplied associate-/r*3.3
Simplified3.3
if 2.990901774490909e+25 < c Initial program 24.6
Simplified15.4
rmApplied add-cube-cbrt15.7
Applied times-frac11.8
rmApplied *-un-lft-identity11.8
Applied times-frac9.0
Taylor expanded around 0 8.9
Simplified8.9
rmApplied associate-/l*5.6
Final simplification4.7
herbie shell --seed 2020079 +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)))