- Split input into 3 regimes
if (* im im) < 1.1482653376689949e-262
Initial program 42.2
\[0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)}\]
Taylor expanded around -inf 36.0
\[\leadsto 0.5 \cdot \sqrt{2.0 \cdot \color{blue}{\left(-2 \cdot re\right)}}\]
if 1.1482653376689949e-262 < (* im im) < 1.0548611829945029e+282
Initial program 22.7
\[0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)}\]
if 1.0548611829945029e+282 < (* im im)
Initial program 57.4
\[0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)}\]
- Using strategy
rm Applied add-cube-cbrt57.4
\[\leadsto 0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{\color{blue}{\left(\sqrt[3]{re \cdot re + im \cdot im} \cdot \sqrt[3]{re \cdot re + im \cdot im}\right) \cdot \sqrt[3]{re \cdot re + im \cdot im}}} - re\right)}\]
Taylor expanded around 0 34.2
\[\leadsto 0.5 \cdot \sqrt{2.0 \cdot \left(\color{blue}{im} - re\right)}\]
- Recombined 3 regimes into one program.
Final simplification29.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \cdot im \le 1.1482653376689949 \cdot 10^{-262}:\\
\;\;\;\;0.5 \cdot \sqrt{\left(re \cdot -2\right) \cdot 2.0}\\
\mathbf{elif}\;im \cdot im \le 1.0548611829945029 \cdot 10^{+282}:\\
\;\;\;\;0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{im \cdot im + re \cdot re} - re\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2.0 \cdot \left(im - re\right)} \cdot 0.5\\
\end{array}\]