- Split input into 3 regimes
if re < -2.200646663461323e+133
Initial program 54.4
\[\sqrt{re \cdot re + im \cdot im}\]
- Using strategy
rm Applied add-sqr-sqrt54.5
\[\leadsto \color{blue}{\sqrt{\sqrt{re \cdot re + im \cdot im}} \cdot \sqrt{\sqrt{re \cdot re + im \cdot im}}}\]
Taylor expanded around -inf 8.5
\[\leadsto \color{blue}{-1 \cdot re}\]
Simplified8.5
\[\leadsto \color{blue}{-re}\]
if -2.200646663461323e+133 < re < 9.047662084790376e+147
Initial program 20.1
\[\sqrt{re \cdot re + im \cdot im}\]
if 9.047662084790376e+147 < re
Initial program 57.3
\[\sqrt{re \cdot re + im \cdot im}\]
Taylor expanded around inf 7.7
\[\leadsto \color{blue}{re}\]
- Recombined 3 regimes into one program.
Final simplification16.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \le -2.200646663461323 \cdot 10^{+133}:\\
\;\;\;\;-re\\
\mathbf{elif}\;re \le 9.047662084790376 \cdot 10^{+147}:\\
\;\;\;\;\sqrt{im \cdot im + re \cdot re}\\
\mathbf{else}:\\
\;\;\;\;re\\
\end{array}\]