\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -9.675631413915364 \cdot 10^{120}:\\
\;\;\;\;\frac{\frac{a2}{b1}}{\frac{b2}{a1}}\\
\mathbf{elif}\;b1 \cdot b2 \le -3.0079329750767313 \cdot 10^{-303}:\\
\;\;\;\;\frac{a2}{\frac{b1 \cdot b2}{a1}}\\
\mathbf{elif}\;b1 \cdot b2 \le 2.21214754521356796 \cdot 10^{-306}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 3.5769750751020911 \cdot 10^{186}:\\
\;\;\;\;\frac{a2}{\frac{b1 \cdot b2}{a1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a2}{b1}}{\frac{b2}{a1}}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r155329 = a1;
double r155330 = a2;
double r155331 = r155329 * r155330;
double r155332 = b1;
double r155333 = b2;
double r155334 = r155332 * r155333;
double r155335 = r155331 / r155334;
return r155335;
}
double f(double a1, double a2, double b1, double b2) {
double r155336 = b1;
double r155337 = b2;
double r155338 = r155336 * r155337;
double r155339 = -9.675631413915364e+120;
bool r155340 = r155338 <= r155339;
double r155341 = a2;
double r155342 = r155341 / r155336;
double r155343 = a1;
double r155344 = r155337 / r155343;
double r155345 = r155342 / r155344;
double r155346 = -3.007932975076731e-303;
bool r155347 = r155338 <= r155346;
double r155348 = r155338 / r155343;
double r155349 = r155341 / r155348;
double r155350 = 2.212147545213568e-306;
bool r155351 = r155338 <= r155350;
double r155352 = r155343 / r155336;
double r155353 = r155341 / r155337;
double r155354 = r155352 * r155353;
double r155355 = 3.576975075102091e+186;
bool r155356 = r155338 <= r155355;
double r155357 = r155356 ? r155349 : r155345;
double r155358 = r155351 ? r155354 : r155357;
double r155359 = r155347 ? r155349 : r155358;
double r155360 = r155340 ? r155345 : r155359;
return r155360;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.0 |
|---|---|
| Target | 11.6 |
| Herbie | 5.6 |
if (* b1 b2) < -9.675631413915364e+120 or 3.576975075102091e+186 < (* b1 b2) Initial program 13.6
rmApplied clear-num13.9
rmApplied associate-/r*13.9
Taylor expanded around 0 13.6
Simplified13.7
rmApplied *-un-lft-identity13.7
Applied times-frac8.0
Applied associate-/r*5.5
Simplified5.5
if -9.675631413915364e+120 < (* b1 b2) < -3.007932975076731e-303 or 2.212147545213568e-306 < (* b1 b2) < 3.576975075102091e+186Initial program 4.9
rmApplied clear-num5.1
rmApplied associate-/r*5.8
Taylor expanded around 0 4.9
Simplified5.4
if -3.007932975076731e-303 < (* b1 b2) < 2.212147545213568e-306Initial program 58.2
rmApplied times-frac8.7
Final simplification5.6
herbie shell --seed 2020024
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))