\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 -1.9994054055991995 \cdot 10^{44}:\\
\;\;\;\;\mathsf{fma}\left(-4, t \cdot \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{z \cdot c}, \frac{b}{z \cdot c}\right)\right)\\
\mathbf{elif}\;c \le 5.37240412345229966 \cdot 10^{57}:\\
\;\;\;\;\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{c}} \cdot \frac{a}{\sqrt{c}}, \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z \cdot c}\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c) {
double r670269 = x;
double r670270 = 9.0;
double r670271 = r670269 * r670270;
double r670272 = y;
double r670273 = r670271 * r670272;
double r670274 = z;
double r670275 = 4.0;
double r670276 = r670274 * r670275;
double r670277 = t;
double r670278 = r670276 * r670277;
double r670279 = a;
double r670280 = r670278 * r670279;
double r670281 = r670273 - r670280;
double r670282 = b;
double r670283 = r670281 + r670282;
double r670284 = c;
double r670285 = r670274 * r670284;
double r670286 = r670283 / r670285;
return r670286;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r670287 = c;
double r670288 = -1.9994054055991995e+44;
bool r670289 = r670287 <= r670288;
double r670290 = 4.0;
double r670291 = -r670290;
double r670292 = t;
double r670293 = a;
double r670294 = r670293 / r670287;
double r670295 = r670292 * r670294;
double r670296 = 9.0;
double r670297 = x;
double r670298 = y;
double r670299 = r670297 * r670298;
double r670300 = z;
double r670301 = r670300 * r670287;
double r670302 = r670299 / r670301;
double r670303 = b;
double r670304 = r670303 / r670301;
double r670305 = fma(r670296, r670302, r670304);
double r670306 = fma(r670291, r670295, r670305);
double r670307 = 5.3724041234523e+57;
bool r670308 = r670287 <= r670307;
double r670309 = r670292 * r670293;
double r670310 = r670309 / r670287;
double r670311 = r670296 * r670297;
double r670312 = fma(r670311, r670298, r670303);
double r670313 = r670312 / r670300;
double r670314 = r670313 / r670287;
double r670315 = fma(r670291, r670310, r670314);
double r670316 = sqrt(r670287);
double r670317 = r670292 / r670316;
double r670318 = r670293 / r670316;
double r670319 = r670317 * r670318;
double r670320 = r670312 / r670301;
double r670321 = fma(r670291, r670319, r670320);
double r670322 = r670308 ? r670315 : r670321;
double r670323 = r670289 ? r670306 : r670322;
return r670323;
}




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.6 |
|---|---|
| Target | 14.9 |
| Herbie | 9.0 |
if c < -1.9994054055991995e+44Initial program 24.5
Simplified16.4
rmApplied *-un-lft-identity16.4
Applied times-frac12.9
Simplified12.9
rmApplied div-inv12.9
Taylor expanded around 0 12.8
Simplified12.8
if -1.9994054055991995e+44 < c < 5.3724041234523e+57Initial program 15.3
Simplified5.5
rmApplied associate-/r*4.1
Simplified4.1
if 5.3724041234523e+57 < c Initial program 24.0
Simplified17.5
rmApplied *-un-lft-identity17.5
Applied times-frac12.7
Simplified12.7
Taylor expanded around 0 12.6
Simplified12.6
rmApplied add-sqr-sqrt12.7
Applied *-un-lft-identity12.7
Applied times-frac12.8
Applied associate-*r*12.0
Simplified12.0
Final simplification9.0
herbie shell --seed 2020083 +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)))