\frac{a1 \cdot a2}{b1 \cdot b2}
\begin{array}{l}
t_0 := \frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;a1 \cdot \frac{1}{\frac{b1}{\frac{a2}{b2}}}\\
\mathbf{elif}\;t_0 \leq -1.3142776653186078 \cdot 10^{-294}:\\
\;\;\;\;\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{a1} \cdot \sqrt[3]{a1}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\left(a2 \cdot \frac{t_1}{b1}\right) \cdot \frac{\sqrt[3]{a1}}{b2}\\
\mathbf{elif}\;t_0 \leq 5.037792537121833 \cdot 10^{+183}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{\frac{\sqrt[3]{b1} \cdot \sqrt[3]{b1}}{\frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}}} \cdot \frac{\sqrt[3]{a1}}{\frac{\sqrt[3]{b1}}{\frac{\sqrt[3]{a2}}{\sqrt[3]{b2}}}}\\
\end{array}\\
\end{array}
(FPCore (a1 a2 b1 b2) :precision binary64 (/ (* a1 a2) (* b1 b2)))
(FPCore (a1 a2 b1 b2)
:precision binary64
(let* ((t_0 (/ (* a1 a2) (* b1 b2))))
(if (<= t_0 (- INFINITY))
(* a1 (/ 1.0 (/ b1 (/ a2 b2))))
(if (<= t_0 -1.3142776653186078e-294)
(* (* a1 a2) (/ 1.0 (* b1 b2)))
(let* ((t_1 (* (cbrt a1) (cbrt a1))))
(if (<= t_0 0.0)
(* (* a2 (/ t_1 b1)) (/ (cbrt a1) b2))
(if (<= t_0 5.037792537121833e+183)
t_0
(*
(/
t_1
(/
(* (cbrt b1) (cbrt b1))
(/ (* (cbrt a2) (cbrt a2)) (* (cbrt b2) (cbrt b2)))))
(/ (cbrt a1) (/ (cbrt b1) (/ (cbrt a2) (cbrt b2))))))))))))double code(double a1, double a2, double b1, double b2) {
return (a1 * a2) / (b1 * b2);
}
double code(double a1, double a2, double b1, double b2) {
double t_0 = (a1 * a2) / (b1 * b2);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = a1 * (1.0 / (b1 / (a2 / b2)));
} else if (t_0 <= -1.3142776653186078e-294) {
tmp = (a1 * a2) * (1.0 / (b1 * b2));
} else {
double t_1 = cbrt(a1) * cbrt(a1);
double tmp_1;
if (t_0 <= 0.0) {
tmp_1 = (a2 * (t_1 / b1)) * (cbrt(a1) / b2);
} else if (t_0 <= 5.037792537121833e+183) {
tmp_1 = t_0;
} else {
tmp_1 = (t_1 / ((cbrt(b1) * cbrt(b1)) / ((cbrt(a2) * cbrt(a2)) / (cbrt(b2) * cbrt(b2))))) * (cbrt(a1) / (cbrt(b1) / (cbrt(a2) / cbrt(b2))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.4 |
|---|---|
| Target | 11.6 |
| Herbie | 2.6 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
rmApplied associate-/l*_binary6429.6
Simplified16.6
rmApplied div-inv_binary6417.1
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -1.3142776653186078e-294Initial program 0.7
rmApplied div-inv_binary641.1
if -1.3142776653186078e-294 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -0.0Initial program 13.4
rmApplied associate-/l*_binary647.7
Simplified3.8
rmApplied associate-/r/_binary644.1
Applied add-cube-cbrt_binary644.2
Applied times-frac_binary643.4
Simplified3.2
if -0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 5.0377925371218328e183Initial program 0.6
if 5.0377925371218328e183 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 40.2
rmApplied associate-/l*_binary6434.6
Simplified15.2
rmApplied add-cube-cbrt_binary6416.0
Applied add-cube-cbrt_binary6416.2
Applied times-frac_binary6416.2
Applied add-cube-cbrt_binary6416.3
Applied times-frac_binary6413.9
Applied add-cube-cbrt_binary6414.1
Applied times-frac_binary644.8
Final simplification2.6
herbie shell --seed 2021190
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))