\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty \lor \neg \left(\frac{a1 \cdot a2}{b1 \cdot b2} \le -6.28254 \cdot 10^{-319} \lor \neg \left(\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.16422584143949291 \cdot 10^{-290} \lor \neg \left(\frac{a1 \cdot a2}{b1 \cdot b2} \le 6.1160527718578736 \cdot 10^{209}\right)\right)\right):\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r274556 = a1;
double r274557 = a2;
double r274558 = r274556 * r274557;
double r274559 = b1;
double r274560 = b2;
double r274561 = r274559 * r274560;
double r274562 = r274558 / r274561;
return r274562;
}
double f(double a1, double a2, double b1, double b2) {
double r274563 = a1;
double r274564 = a2;
double r274565 = r274563 * r274564;
double r274566 = b1;
double r274567 = b2;
double r274568 = r274566 * r274567;
double r274569 = r274565 / r274568;
double r274570 = -inf.0;
bool r274571 = r274569 <= r274570;
double r274572 = -6.2825387525173e-319;
bool r274573 = r274569 <= r274572;
double r274574 = 1.1642258414394929e-290;
bool r274575 = r274569 <= r274574;
double r274576 = 6.1160527718578736e+209;
bool r274577 = r274569 <= r274576;
double r274578 = !r274577;
bool r274579 = r274575 || r274578;
double r274580 = !r274579;
bool r274581 = r274573 || r274580;
double r274582 = !r274581;
bool r274583 = r274571 || r274582;
double r274584 = r274563 / r274566;
double r274585 = r274564 / r274567;
double r274586 = r274584 * r274585;
double r274587 = r274583 ? r274586 : r274569;
return r274587;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.1 |
|---|---|
| Target | 11.6 |
| Herbie | 2.9 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0 or -6.2825387525173e-319 < (/ (* a1 a2) (* b1 b2)) < 1.1642258414394929e-290 or 6.1160527718578736e+209 < (/ (* a1 a2) (* b1 b2)) Initial program 23.1
rmApplied times-frac5.4
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -6.2825387525173e-319 or 1.1642258414394929e-290 < (/ (* a1 a2) (* b1 b2)) < 6.1160527718578736e+209Initial program 0.8
rmApplied associate-/l*8.0
rmApplied associate-/r/8.1
rmApplied pow18.1
Applied pow18.1
Applied pow-prod-down8.1
Simplified0.8
Final simplification2.9
herbie shell --seed 2020046
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))