\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}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) {
return ((double) (((double) sin(th)) * ((double) (((double) sin(ky)) / ((double) hypot(((double) sin(ky)), ((double) sin(kx))))))));
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 3.8
Taylor expanded around inf 3.8
Simplified0.2
rmApplied clear-num0.3
Applied associate-*l/0.2
Simplified0.2
rmApplied div-inv0.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2020114 +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)))