\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{c \cdot z} = -\infty:\\
\;\;\;\;\frac{\frac{1}{c}}{\frac{1}{\mathsf{fma}\left(y \cdot \frac{x}{z}, 9.0, \frac{b}{z}\right) - a \cdot \left(4.0 \cdot t\right)}}\\
\mathbf{elif}\;\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{c \cdot z} \le -5.462426595109968 \cdot 10^{-122}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{c \cdot z}\\
\mathbf{elif}\;\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{c \cdot z} \le 0.0:\\
\;\;\;\;\frac{1}{\frac{1}{\sqrt[3]{\frac{\mathsf{fma}\left(x \cdot 9.0, y, b\right)}{z} - a \cdot \left(4.0 \cdot t\right)} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(x \cdot 9.0, y, b\right)}{z} - a \cdot \left(4.0 \cdot t\right)}}} \cdot \frac{1}{\frac{c}{\sqrt[3]{\frac{\mathsf{fma}\left(x \cdot 9.0, y, b\right)}{z} - a \cdot \left(4.0 \cdot t\right)}}}\\
\mathbf{elif}\;\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{c \cdot z} \le 9.076115171897018 \cdot 10^{+306}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9.0\right) \cdot y - \left(\left(z \cdot 4.0\right) \cdot t\right) \cdot a\right) + b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{c}}{\frac{1}{\mathsf{fma}\left(y \cdot \frac{x}{z}, 9.0, \frac{b}{z}\right) - a \cdot \left(4.0 \cdot t\right)}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c) {
double r33454183 = x;
double r33454184 = 9.0;
double r33454185 = r33454183 * r33454184;
double r33454186 = y;
double r33454187 = r33454185 * r33454186;
double r33454188 = z;
double r33454189 = 4.0;
double r33454190 = r33454188 * r33454189;
double r33454191 = t;
double r33454192 = r33454190 * r33454191;
double r33454193 = a;
double r33454194 = r33454192 * r33454193;
double r33454195 = r33454187 - r33454194;
double r33454196 = b;
double r33454197 = r33454195 + r33454196;
double r33454198 = c;
double r33454199 = r33454188 * r33454198;
double r33454200 = r33454197 / r33454199;
return r33454200;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r33454201 = x;
double r33454202 = 9.0;
double r33454203 = r33454201 * r33454202;
double r33454204 = y;
double r33454205 = r33454203 * r33454204;
double r33454206 = z;
double r33454207 = 4.0;
double r33454208 = r33454206 * r33454207;
double r33454209 = t;
double r33454210 = r33454208 * r33454209;
double r33454211 = a;
double r33454212 = r33454210 * r33454211;
double r33454213 = r33454205 - r33454212;
double r33454214 = b;
double r33454215 = r33454213 + r33454214;
double r33454216 = c;
double r33454217 = r33454216 * r33454206;
double r33454218 = r33454215 / r33454217;
double r33454219 = -inf.0;
bool r33454220 = r33454218 <= r33454219;
double r33454221 = 1.0;
double r33454222 = r33454221 / r33454216;
double r33454223 = r33454201 / r33454206;
double r33454224 = r33454204 * r33454223;
double r33454225 = r33454214 / r33454206;
double r33454226 = fma(r33454224, r33454202, r33454225);
double r33454227 = r33454207 * r33454209;
double r33454228 = r33454211 * r33454227;
double r33454229 = r33454226 - r33454228;
double r33454230 = r33454221 / r33454229;
double r33454231 = r33454222 / r33454230;
double r33454232 = -5.462426595109968e-122;
bool r33454233 = r33454218 <= r33454232;
double r33454234 = 0.0;
bool r33454235 = r33454218 <= r33454234;
double r33454236 = fma(r33454203, r33454204, r33454214);
double r33454237 = r33454236 / r33454206;
double r33454238 = r33454237 - r33454228;
double r33454239 = cbrt(r33454238);
double r33454240 = r33454239 * r33454239;
double r33454241 = r33454221 / r33454240;
double r33454242 = r33454221 / r33454241;
double r33454243 = r33454216 / r33454239;
double r33454244 = r33454221 / r33454243;
double r33454245 = r33454242 * r33454244;
double r33454246 = 9.076115171897018e+306;
bool r33454247 = r33454218 <= r33454246;
double r33454248 = r33454247 ? r33454218 : r33454231;
double r33454249 = r33454235 ? r33454245 : r33454248;
double r33454250 = r33454233 ? r33454218 : r33454249;
double r33454251 = r33454220 ? r33454231 : r33454250;
return r33454251;
}




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
| Original | 20.1 |
|---|---|
| Target | 14.5 |
| Herbie | 5.0 |
if (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < -inf.0 or 9.076115171897018e+306 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) Initial program 61.0
Simplified25.6
rmApplied *-un-lft-identity25.6
Applied associate-/r*25.6
Simplified25.7
rmApplied clear-num25.8
rmApplied div-inv25.8
Applied associate-/r*25.8
Taylor expanded around 0 25.7
Simplified17.3
if -inf.0 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < -5.462426595109968e-122 or 0.0 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 9.076115171897018e+306Initial program 0.8
if -5.462426595109968e-122 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 0.0Initial program 28.6
Simplified0.7
rmApplied *-un-lft-identity0.7
Applied associate-/r*0.7
Simplified0.6
rmApplied clear-num1.4
rmApplied add-cube-cbrt2.1
Applied *-un-lft-identity2.1
Applied times-frac2.1
Applied *-un-lft-identity2.1
Applied times-frac1.4
Final simplification5.0
herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-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)))