\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\begin{array}{l}
\mathbf{if}\;\sin kx \leq 1.0096888392816624 \cdot 10^{-287} \lor \neg \left(\sin kx \leq 3.3387457623946804 \cdot 10^{-245}\right):\\
\;\;\;\;\left(\sin ky \cdot \sqrt{\frac{1}{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}\right) \cdot \sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left(1 - \left(kx \cdot kx\right) \cdot 0.16666666666666666\right)\\
\end{array}(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
(FPCore (kx ky th)
:precision binary64
(if (or (<= (sin kx) 1.0096888392816624e-287)
(not (<= (sin kx) 3.3387457623946804e-245)))
(*
(* (sin ky) (sqrt (/ 1.0 (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))))
(sin th))
(* (sin th) (- 1.0 (* (* kx kx) 0.16666666666666666)))))double code(double kx, double ky, double th) {
return ((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 tmp;
if (((((double) sin(kx)) <= 1.0096888392816624e-287) || !(((double) sin(kx)) <= 3.3387457623946804e-245))) {
tmp = ((double) (((double) (((double) sin(ky)) * ((double) sqrt((1.0 / ((double) (((double) pow(((double) sin(kx)), 2.0)) + ((double) pow(((double) sin(ky)), 2.0))))))))) * ((double) sin(th))));
} else {
tmp = ((double) (((double) sin(th)) * ((double) (1.0 - ((double) (((double) (kx * kx)) * 0.16666666666666666))))));
}
return tmp;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
if (sin.f64 kx) < 1.00968883928166238e-287 or 3.3387457623946804e-245 < (sin.f64 kx) Initial program 3.8
Taylor expanded around inf 4.1
Simplified4.1
if 1.00968883928166238e-287 < (sin.f64 kx) < 3.3387457623946804e-245Initial program 16.6
rmApplied clear-num_binary6416.6
Taylor expanded around 0 34.3
Simplified34.3
Final simplification5.2
herbie shell --seed 2020210
(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)))