\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -2.32021152475378652 \cdot 10^{210}:\\
\;\;\;\;\left(\frac{a1}{b1} \cdot a2\right) \cdot \frac{1}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -4.173350324846027 \cdot 10^{-151}:\\
\;\;\;\;a1 \cdot \frac{a2}{b2 \cdot b1}\\
\mathbf{elif}\;b1 \cdot b2 \le -0.0 \lor \neg \left(b1 \cdot b2 \le 7.6189236997402214 \cdot 10^{265}\right):\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r129093 = a1;
double r129094 = a2;
double r129095 = r129093 * r129094;
double r129096 = b1;
double r129097 = b2;
double r129098 = r129096 * r129097;
double r129099 = r129095 / r129098;
return r129099;
}
double f(double a1, double a2, double b1, double b2) {
double r129100 = b1;
double r129101 = b2;
double r129102 = r129100 * r129101;
double r129103 = -2.3202115247537865e+210;
bool r129104 = r129102 <= r129103;
double r129105 = a1;
double r129106 = r129105 / r129100;
double r129107 = a2;
double r129108 = r129106 * r129107;
double r129109 = 1.0;
double r129110 = r129109 / r129101;
double r129111 = r129108 * r129110;
double r129112 = -4.173350324846027e-151;
bool r129113 = r129102 <= r129112;
double r129114 = r129101 * r129100;
double r129115 = r129107 / r129114;
double r129116 = r129105 * r129115;
double r129117 = -0.0;
bool r129118 = r129102 <= r129117;
double r129119 = 7.618923699740221e+265;
bool r129120 = r129102 <= r129119;
double r129121 = !r129120;
bool r129122 = r129118 || r129121;
double r129123 = r129107 / r129101;
double r129124 = r129106 * r129123;
double r129125 = r129105 * r129107;
double r129126 = r129102 / r129125;
double r129127 = r129109 / r129126;
double r129128 = r129122 ? r129124 : r129127;
double r129129 = r129113 ? r129116 : r129128;
double r129130 = r129104 ? r129111 : r129129;
return r129130;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 10.7 |
|---|---|
| Target | 11.2 |
| Herbie | 5.5 |
if (* b1 b2) < -2.3202115247537865e+210Initial program 15.4
rmApplied div-inv15.4
rmApplied *-un-lft-identity15.4
Applied times-frac14.8
Applied associate-*r*7.7
Simplified4.1
if -2.3202115247537865e+210 < (* b1 b2) < -4.173350324846027e-151Initial program 3.7
rmApplied div-inv3.7
rmApplied div-inv3.7
Simplified3.7
rmApplied associate-*l*4.3
Simplified4.3
if -4.173350324846027e-151 < (* b1 b2) < -0.0 or 7.618923699740221e+265 < (* b1 b2) Initial program 25.9
rmApplied times-frac7.4
if -0.0 < (* b1 b2) < 7.618923699740221e+265Initial program 5.6
rmApplied clear-num5.9
Final simplification5.5
herbie shell --seed 2020043
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))