\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.467871422320185237629772284274375035079 \cdot 10^{-213}:\\
\;\;\;\;\mathsf{fma}\left(-4, t \cdot \frac{a}{c}, {\left(\mathsf{fma}\left(9, \frac{x \cdot y}{z \cdot c}, \frac{b}{z \cdot c}\right)\right)}^{1}\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 1.612423463345041752995521763691113217843 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{1}{\frac{c}{t \cdot a}}, \frac{1}{z} \cdot \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{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 1.228454670464632119386236983422480410104 \cdot 10^{305}:\\
\;\;\;\;\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, t \cdot \frac{a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c) {
double r652728 = x;
double r652729 = 9.0;
double r652730 = r652728 * r652729;
double r652731 = y;
double r652732 = r652730 * r652731;
double r652733 = z;
double r652734 = 4.0;
double r652735 = r652733 * r652734;
double r652736 = t;
double r652737 = r652735 * r652736;
double r652738 = a;
double r652739 = r652737 * r652738;
double r652740 = r652732 - r652739;
double r652741 = b;
double r652742 = r652740 + r652741;
double r652743 = c;
double r652744 = r652733 * r652743;
double r652745 = r652742 / r652744;
return r652745;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r652746 = x;
double r652747 = 9.0;
double r652748 = r652746 * r652747;
double r652749 = y;
double r652750 = r652748 * r652749;
double r652751 = z;
double r652752 = 4.0;
double r652753 = r652751 * r652752;
double r652754 = t;
double r652755 = r652753 * r652754;
double r652756 = a;
double r652757 = r652755 * r652756;
double r652758 = r652750 - r652757;
double r652759 = b;
double r652760 = r652758 + r652759;
double r652761 = c;
double r652762 = r652751 * r652761;
double r652763 = r652760 / r652762;
double r652764 = -4.467871422320185e-213;
bool r652765 = r652763 <= r652764;
double r652766 = -r652752;
double r652767 = r652756 / r652761;
double r652768 = r652754 * r652767;
double r652769 = r652746 * r652749;
double r652770 = r652769 / r652762;
double r652771 = r652759 / r652762;
double r652772 = fma(r652747, r652770, r652771);
double r652773 = 1.0;
double r652774 = pow(r652772, r652773);
double r652775 = fma(r652766, r652768, r652774);
double r652776 = 1.6124234633450418e-303;
bool r652777 = r652763 <= r652776;
double r652778 = r652754 * r652756;
double r652779 = r652761 / r652778;
double r652780 = r652773 / r652779;
double r652781 = r652773 / r652751;
double r652782 = r652747 * r652746;
double r652783 = fma(r652782, r652749, r652759);
double r652784 = r652783 / r652761;
double r652785 = r652781 * r652784;
double r652786 = fma(r652766, r652780, r652785);
double r652787 = 1.2284546704646321e+305;
bool r652788 = r652763 <= r652787;
double r652789 = r652783 / r652751;
double r652790 = r652789 / r652761;
double r652791 = fma(r652766, r652768, r652790);
double r652792 = r652788 ? r652763 : r652791;
double r652793 = r652777 ? r652786 : r652792;
double r652794 = r652765 ? r652775 : r652793;
return r652794;
}




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.4 |
|---|---|
| Target | 15.0 |
| Herbie | 7.5 |
if (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < -4.467871422320185e-213Initial program 12.5
Simplified8.4
rmApplied *-un-lft-identity8.4
Applied times-frac12.6
Simplified12.6
rmApplied *-un-lft-identity12.6
Applied times-frac11.4
Simplified11.4
rmApplied pow111.4
Applied pow111.4
Applied pow-prod-down11.4
Simplified11.3
Taylor expanded around 0 7.7
Simplified7.7
if -4.467871422320185e-213 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 1.6124234633450418e-303Initial program 34.5
Simplified20.9
rmApplied *-un-lft-identity20.9
Applied times-frac2.0
Simplified2.0
rmApplied clear-num2.2
if 1.6124234633450418e-303 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) < 1.2284546704646321e+305Initial program 0.7
if 1.2284546704646321e+305 < (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) Initial program 63.3
Simplified31.5
rmApplied *-un-lft-identity31.5
Applied times-frac29.7
Simplified29.9
rmApplied *-un-lft-identity29.9
Applied times-frac24.1
Simplified24.1
rmApplied associate-*r/22.4
Simplified22.4
Final simplification7.5
herbie shell --seed 2019353 +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)))