- Split input into 2 regimes
if (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) < 1.0
Initial program 11.1
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
- Using strategy
rm Applied div-inv11.2
\[\leadsto \color{blue}{\left(\sin ky \cdot \frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}\right)} \cdot \sin th\]
Applied associate-*l*11.2
\[\leadsto \color{blue}{\sin ky \cdot \left(\frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\right)}\]
if 1.0 < (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))
Initial program 61.8
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
- Using strategy
rm Applied div-inv61.8
\[\leadsto \color{blue}{\left(\sin ky \cdot \frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}\right)} \cdot \sin th\]
Applied associate-*l*61.8
\[\leadsto \color{blue}{\sin ky \cdot \left(\frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\right)}\]
Taylor expanded around 0 32.6
\[\leadsto \sin ky \cdot \left(\frac{1}{\color{blue}{\left(\frac{1}{12} \cdot \left({kx}^{2} \cdot ky\right) + ky\right) - \frac{1}{6} \cdot {ky}^{3}}} \cdot \sin th\right)\]
Simplified32.6
\[\leadsto \sin ky \cdot \left(\frac{1}{\color{blue}{ky - \left(\left(ky \cdot \frac{1}{6}\right) \cdot ky - \left(\frac{1}{12} \cdot kx\right) \cdot kx\right) \cdot ky}} \cdot \sin th\right)\]
- Recombined 2 regimes into one program.
Final simplification11.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \le 1.0:\\
\;\;\;\;\left(\frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\right) \cdot \sin ky\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left(\sin th \cdot \frac{1}{ky - ky \cdot \left(ky \cdot \left(ky \cdot \frac{1}{6}\right) - kx \cdot \left(kx \cdot \frac{1}{12}\right)\right)}\right)\\
\end{array}\]