- Split input into 4 regimes
if x < -1.62541230777024819e124
Initial program 57.7
\[\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\]
Taylor expanded around -inf 17.7
\[\leadsto \color{blue}{-1 \cdot \left(x \cdot \sqrt{0.333333333333333315}\right)}\]
Simplified17.7
\[\leadsto \color{blue}{x \cdot \left(-\sqrt{0.333333333333333315}\right)}\]
if -1.62541230777024819e124 < x < 1.9270970714388626e-244 or 7.533467640903301e-175 < x < 3.7246790297724069e84
Initial program 28.7
\[\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\]
Taylor expanded around 0 28.8
\[\leadsto \sqrt{\color{blue}{0.333333333333333315 \cdot {x}^{2} + \left(0.333333333333333315 \cdot {y}^{2} + 0.333333333333333315 \cdot {z}^{2}\right)}}\]
Simplified28.8
\[\leadsto \sqrt{\color{blue}{\left(x \cdot x + \left(y \cdot y + z \cdot z\right)\right) \cdot 0.333333333333333315}}\]
if 1.9270970714388626e-244 < x < 7.533467640903301e-175
Initial program 33.2
\[\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\]
- Using strategy
rm Applied sqrt-div33.3
\[\leadsto \color{blue}{\frac{\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}}{\sqrt{3}}}\]
Simplified33.3
\[\leadsto \frac{\color{blue}{\sqrt{x \cdot x + \left(y \cdot y + z \cdot z\right)}}}{\sqrt{3}}\]
Taylor expanded around 0 47.9
\[\leadsto \frac{\color{blue}{z}}{\sqrt{3}}\]
- Using strategy
rm Applied *-un-lft-identity47.9
\[\leadsto \frac{z}{\sqrt{\color{blue}{1 \cdot 3}}}\]
Applied sqrt-prod47.9
\[\leadsto \frac{z}{\color{blue}{\sqrt{1} \cdot \sqrt{3}}}\]
Applied add-sqr-sqrt48.4
\[\leadsto \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt{1} \cdot \sqrt{3}}\]
Applied times-frac48.4
\[\leadsto \color{blue}{\frac{\sqrt{z}}{\sqrt{1}} \cdot \frac{\sqrt{z}}{\sqrt{3}}}\]
Simplified48.4
\[\leadsto \color{blue}{\sqrt{z}} \cdot \frac{\sqrt{z}}{\sqrt{3}}\]
if 3.7246790297724069e84 < x
Initial program 53.3
\[\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\]
Taylor expanded around inf 19.5
\[\leadsto \color{blue}{x \cdot \sqrt{0.333333333333333315}}\]
- Recombined 4 regimes into one program.
Final simplification26.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -1.62541230777024819 \cdot 10^{124}:\\
\;\;\;\;x \cdot \left(-\sqrt{0.333333333333333315}\right)\\
\mathbf{elif}\;x \le 1.9270970714388626 \cdot 10^{-244}:\\
\;\;\;\;\sqrt{0.333333333333333315 \cdot \left(x \cdot x + \left(y \cdot y + z \cdot z\right)\right)}\\
\mathbf{elif}\;x \le 7.533467640903301 \cdot 10^{-175}:\\
\;\;\;\;\sqrt{z} \cdot \frac{\sqrt{z}}{\sqrt{3}}\\
\mathbf{elif}\;x \le 3.7246790297724069 \cdot 10^{84}:\\
\;\;\;\;\sqrt{0.333333333333333315 \cdot \left(x \cdot x + \left(y \cdot y + z \cdot z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{0.333333333333333315}\\
\end{array}\]