- Split input into 3 regimes
if (/ (* a1 a2) (* b1 b2)) < -inf.0 or 5.21624264135564e+298 < (/ (* a1 a2) (* b1 b2))
Initial program 59.3
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied times-frac8.5
\[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -1.4730004851386487e-292 or -0.0 < (/ (* a1 a2) (* b1 b2)) < 5.21624264135564e+298
Initial program 0.8
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
if -1.4730004851386487e-292 < (/ (* a1 a2) (* b1 b2)) < -0.0
Initial program 13.1
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
- Using strategy
rm Applied div-inv13.2
\[\leadsto \color{blue}{\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}}\]
- Using strategy
rm Applied associate-/r*12.5
\[\leadsto \left(a1 \cdot a2\right) \cdot \color{blue}{\frac{\frac{1}{b1}}{b2}}\]
- Using strategy
rm Applied pow112.5
\[\leadsto \left(a1 \cdot a2\right) \cdot \color{blue}{{\left(\frac{\frac{1}{b1}}{b2}\right)}^{1}}\]
Applied pow112.5
\[\leadsto \color{blue}{{\left(a1 \cdot a2\right)}^{1}} \cdot {\left(\frac{\frac{1}{b1}}{b2}\right)}^{1}\]
Applied pow-prod-down12.5
\[\leadsto \color{blue}{{\left(\left(a1 \cdot a2\right) \cdot \frac{\frac{1}{b1}}{b2}\right)}^{1}}\]
Simplified2.5
\[\leadsto {\color{blue}{\left(\frac{a1}{b2} \cdot \frac{a2}{b1}\right)}}^{1}\]
- Using strategy
rm Applied associate-*l/3.6
\[\leadsto {\color{blue}{\left(\frac{a1 \cdot \frac{a2}{b1}}{b2}\right)}}^{1}\]
- Recombined 3 regimes into one program.
Final simplification2.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.4730004851386487 \cdot 10^{-292}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -0.0:\\
\;\;\;\;\frac{a1 \cdot \frac{a2}{b1}}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 5.21624264135564 \cdot 10^{+298}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\end{array}\]