\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\begin{array}{l}
\mathbf{if}\;\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \le 0.999999946980715:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{1}{6} \cdot {kx}^{2}\right) \cdot \sin th\\
\end{array}double code(double kx, double ky, double th) {
return ((double) (((double) (((double) sin(ky)) / ((double) sqrt(((double) (((double) pow(((double) sin(kx)), 2.0)) + ((double) pow(((double) sin(ky)), 2.0)))))))) * ((double) sin(th))));
}
double code(double kx, double ky, double th) {
double VAR;
if ((((double) (((double) sin(ky)) / ((double) sqrt(((double) (((double) pow(((double) sin(kx)), 2.0)) + ((double) pow(((double) sin(ky)), 2.0)))))))) <= 0.999999946980715)) {
VAR = ((double) (((double) sin(ky)) * ((double) (((double) sin(th)) / ((double) sqrt(((double) (((double) pow(((double) sin(kx)), 2.0)) + ((double) pow(((double) sin(ky)), 2.0))))))))));
} else {
VAR = ((double) (((double) (1.0 - ((double) (0.16666666666666666 * ((double) pow(kx, 2.0)))))) * ((double) sin(th))));
}
return VAR;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
if (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) < 0.999999946980715Initial program 2.6
rmApplied div-inv2.7
Applied associate-*l*2.7
Simplified2.6
if 0.999999946980715 < (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) Initial program 8.5
Taylor expanded around inf 8.8
Taylor expanded around 0 3.8
Final simplification2.8
herbie shell --seed 2020155
(FPCore (kx ky th)
:name "Toniolo and Linder, Equation (3b), real"
:precision binary64
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))