\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}\;\left(x \cdot 9\right) \cdot y = -\infty:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\frac{c}{a}}, \mathsf{fma}\left(9, \frac{\frac{x}{z}}{\frac{c}{y}}, \frac{b}{z \cdot c}\right)\right)\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le -8.108948328176708 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(-4, t \cdot \frac{a}{c}, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z \cdot c}\right)\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le -6.60707305569133659 \cdot 10^{-206}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 1.61237712410997147 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{c} \cdot a, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z \cdot c}\right)\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 1.87487065300391919 \cdot 10^{-101}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 1.32349191519405003 \cdot 10^{111}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\frac{c}{a}}, \frac{1}{z} \cdot \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t}{\frac{c}{a}}, \mathsf{fma}\left(9, \frac{\frac{x}{z}}{\frac{c}{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 r754987 = x;
double r754988 = 9.0;
double r754989 = r754987 * r754988;
double r754990 = y;
double r754991 = r754989 * r754990;
double r754992 = z;
double r754993 = 4.0;
double r754994 = r754992 * r754993;
double r754995 = t;
double r754996 = r754994 * r754995;
double r754997 = a;
double r754998 = r754996 * r754997;
double r754999 = r754991 - r754998;
double r755000 = b;
double r755001 = r754999 + r755000;
double r755002 = c;
double r755003 = r754992 * r755002;
double r755004 = r755001 / r755003;
return r755004;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r755005 = x;
double r755006 = 9.0;
double r755007 = r755005 * r755006;
double r755008 = y;
double r755009 = r755007 * r755008;
double r755010 = -inf.0;
bool r755011 = r755009 <= r755010;
double r755012 = 4.0;
double r755013 = -r755012;
double r755014 = t;
double r755015 = c;
double r755016 = a;
double r755017 = r755015 / r755016;
double r755018 = r755014 / r755017;
double r755019 = z;
double r755020 = r755005 / r755019;
double r755021 = r755015 / r755008;
double r755022 = r755020 / r755021;
double r755023 = b;
double r755024 = r755019 * r755015;
double r755025 = r755023 / r755024;
double r755026 = fma(r755006, r755022, r755025);
double r755027 = fma(r755013, r755018, r755026);
double r755028 = -8.108948328176708e-07;
bool r755029 = r755009 <= r755028;
double r755030 = r755016 / r755015;
double r755031 = r755014 * r755030;
double r755032 = r755006 * r755008;
double r755033 = fma(r755005, r755032, r755023);
double r755034 = r755033 / r755024;
double r755035 = fma(r755013, r755031, r755034);
double r755036 = -6.607073055691337e-206;
bool r755037 = r755009 <= r755036;
double r755038 = r755014 * r755016;
double r755039 = r755038 / r755015;
double r755040 = r755006 * r755005;
double r755041 = fma(r755040, r755008, r755023);
double r755042 = r755041 / r755019;
double r755043 = r755042 / r755015;
double r755044 = fma(r755013, r755039, r755043);
double r755045 = 1.6123771241099715e-172;
bool r755046 = r755009 <= r755045;
double r755047 = r755014 / r755015;
double r755048 = r755047 * r755016;
double r755049 = fma(r755013, r755048, r755034);
double r755050 = 1.8748706530039192e-101;
bool r755051 = r755009 <= r755050;
double r755052 = 1.32349191519405e+111;
bool r755053 = r755009 <= r755052;
double r755054 = 1.0;
double r755055 = r755054 / r755019;
double r755056 = r755041 / r755015;
double r755057 = r755055 * r755056;
double r755058 = fma(r755013, r755018, r755057);
double r755059 = r755053 ? r755058 : r755027;
double r755060 = r755051 ? r755044 : r755059;
double r755061 = r755046 ? r755049 : r755060;
double r755062 = r755037 ? r755044 : r755061;
double r755063 = r755029 ? r755035 : r755062;
double r755064 = r755011 ? r755027 : r755063;
return r755064;
}




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.7 |
| Herbie | 8.2 |
if (* (* x 9.0) y) < -inf.0 or 1.32349191519405e+111 < (* (* x 9.0) y) Initial program 37.3
Simplified31.8
rmApplied associate-/l*30.5
Taylor expanded around 0 30.3
Simplified30.3
rmApplied associate-/l*13.9
rmApplied *-un-lft-identity13.9
Applied times-frac8.4
Applied associate-/r*11.7
Simplified11.7
if -inf.0 < (* (* x 9.0) y) < -8.108948328176708e-07Initial program 19.3
Simplified9.7
rmApplied *-un-lft-identity9.7
Applied times-frac8.1
Simplified8.1
if -8.108948328176708e-07 < (* (* x 9.0) y) < -6.607073055691337e-206 or 1.6123771241099715e-172 < (* (* x 9.0) y) < 1.8748706530039192e-101Initial program 17.0
Simplified6.8
rmApplied associate-/r*6.8
Simplified6.8
if -6.607073055691337e-206 < (* (* x 9.0) y) < 1.6123771241099715e-172Initial program 17.7
Simplified8.3
rmApplied associate-/l*8.3
rmApplied associate-/r/8.2
if 1.8748706530039192e-101 < (* (* x 9.0) y) < 1.32349191519405e+111Initial program 16.9
Simplified6.3
rmApplied associate-/l*6.7
rmApplied *-un-lft-identity6.7
Applied times-frac6.7
Simplified6.7
Final simplification8.2
herbie shell --seed 2020027 +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)))