\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\left(\sin ky \cdot \frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\right) \cdot \sin thdouble code(double kx, double ky, double th) {
return ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th));
}
double code(double kx, double ky, double th) {
return ((sin(ky) * (1.0 / (sqrt(hypot(sin(ky), sin(kx))) * sqrt(hypot(sin(ky), sin(kx)))))) * sin(th));
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.5
Taylor expanded around inf 12.5
Simplified8.7
rmApplied div-inv8.7
rmApplied add-sqr-sqrt9.0
Final simplification9.0
herbie shell --seed 2020049 +o rules:numerics
(FPCore (kx ky th)
:name "Toniolo and Linder, Equation (3b), real"
:precision binary64
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))