- Split input into 2 regimes
if (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) < 1.0
Initial program 2.1
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
- Using strategy
rm Applied div-inv2.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*2.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.9
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
Taylor expanded around 0 30.4
\[\leadsto \frac{\sin ky}{\color{blue}{\left(\frac{1}{12} \cdot \left({kx}^{2} \cdot ky\right) + ky\right) - \frac{1}{6} \cdot {ky}^{3}}} \cdot \sin th\]
- Recombined 2 regimes into one program.
Final simplification3.1
\[\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}:\\
\;\;\;\;\frac{\sin ky}{\left(ky + \left(ky \cdot {kx}^{2}\right) \cdot \frac{1}{12}\right) - {ky}^{3} \cdot \frac{1}{6}} \cdot \sin th\\
\end{array}\]