\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}\;\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} \le -4.589443313900608057563261719623579478808 \cdot 10^{256}:\\
\;\;\;\;\mathsf{fma}\left(-4, t \cdot \frac{1}{\frac{c}{a}}, \mathsf{fma}\left(9, \frac{x}{\frac{z \cdot c}{y}}, \frac{b}{z \cdot c}\right)\right)\\
\mathbf{elif}\;\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} \le -3.660883699446386363531884082504499977721 \cdot 10^{-259}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;\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} \le 0.0:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\frac{c}{a}}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{elif}\;\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} \le 7.262603721379823265225963415766089734851 \cdot 10^{295}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\frac{c}{a}}, \mathsf{fma}\left(9, \frac{x}{\frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{c}{\sqrt[3]{y}}}, \frac{b}{z \cdot c}\right)\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c) {
double r777505 = x;
double r777506 = 9.0;
double r777507 = r777505 * r777506;
double r777508 = y;
double r777509 = r777507 * r777508;
double r777510 = z;
double r777511 = 4.0;
double r777512 = r777510 * r777511;
double r777513 = t;
double r777514 = r777512 * r777513;
double r777515 = a;
double r777516 = r777514 * r777515;
double r777517 = r777509 - r777516;
double r777518 = b;
double r777519 = r777517 + r777518;
double r777520 = c;
double r777521 = r777510 * r777520;
double r777522 = r777519 / r777521;
return r777522;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r777523 = x;
double r777524 = 9.0;
double r777525 = r777523 * r777524;
double r777526 = y;
double r777527 = r777525 * r777526;
double r777528 = z;
double r777529 = 4.0;
double r777530 = r777528 * r777529;
double r777531 = t;
double r777532 = r777530 * r777531;
double r777533 = a;
double r777534 = r777532 * r777533;
double r777535 = r777527 - r777534;
double r777536 = b;
double r777537 = r777535 + r777536;
double r777538 = c;
double r777539 = r777528 * r777538;
double r777540 = r777537 / r777539;
double r777541 = -4.589443313900608e+256;
bool r777542 = r777540 <= r777541;
double r777543 = -r777529;
double r777544 = 1.0;
double r777545 = r777538 / r777533;
double r777546 = r777544 / r777545;
double r777547 = r777531 * r777546;
double r777548 = r777539 / r777526;
double r777549 = r777523 / r777548;
double r777550 = r777536 / r777539;
double r777551 = fma(r777524, r777549, r777550);
double r777552 = fma(r777543, r777547, r777551);
double r777553 = -3.6608836994463864e-259;
bool r777554 = r777540 <= r777553;
double r777555 = 0.0;
bool r777556 = r777540 <= r777555;
double r777557 = r777531 / r777545;
double r777558 = r777524 * r777523;
double r777559 = fma(r777558, r777526, r777536);
double r777560 = r777559 / r777528;
double r777561 = r777560 / r777538;
double r777562 = fma(r777543, r777557, r777561);
double r777563 = 7.262603721379823e+295;
bool r777564 = r777540 <= r777563;
double r777565 = cbrt(r777526);
double r777566 = r777565 * r777565;
double r777567 = r777528 / r777566;
double r777568 = r777538 / r777565;
double r777569 = r777567 * r777568;
double r777570 = r777523 / r777569;
double r777571 = fma(r777524, r777570, r777550);
double r777572 = fma(r777543, r777557, r777571);
double r777573 = r777564 ? r777540 : r777572;
double r777574 = r777556 ? r777562 : r777573;
double r777575 = r777554 ? r777540 : r777574;
double r777576 = r777542 ? r777552 : r777575;
return r777576;
}




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.8 |
|---|---|
| Target | 14.6 |
| Herbie | 3.9 |
if (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < -4.589443313900608e+256Initial program 43.2
Simplified20.8
rmApplied associate-/l*17.8
Taylor expanded around 0 17.6
Simplified17.6
rmApplied associate-/l*11.0
rmApplied div-inv11.4
if -4.589443313900608e+256 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < -3.6608836994463864e-259 or 0.0 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 7.262603721379823e+295Initial program 3.8
if -3.6608836994463864e-259 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 0.0Initial program 34.5
Simplified22.9
rmApplied associate-/l*24.3
rmApplied associate-/r*1.8
Simplified1.8
if 7.262603721379823e+295 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) Initial program 61.7
Simplified30.0
rmApplied associate-/l*26.4
Taylor expanded around 0 26.3
Simplified26.3
rmApplied associate-/l*16.3
rmApplied add-cube-cbrt16.4
Applied times-frac11.1
Final simplification3.9
herbie shell --seed 2020002 +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)))