\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot \sin kydouble f(double kx, double ky, double th) {
double r32185 = ky;
double r32186 = sin(r32185);
double r32187 = kx;
double r32188 = sin(r32187);
double r32189 = 2.0;
double r32190 = pow(r32188, r32189);
double r32191 = pow(r32186, r32189);
double r32192 = r32190 + r32191;
double r32193 = sqrt(r32192);
double r32194 = r32186 / r32193;
double r32195 = th;
double r32196 = sin(r32195);
double r32197 = r32194 * r32196;
return r32197;
}
double f(double kx, double ky, double th) {
double r32198 = th;
double r32199 = sin(r32198);
double r32200 = kx;
double r32201 = sin(r32200);
double r32202 = ky;
double r32203 = sin(r32202);
double r32204 = hypot(r32201, r32203);
double r32205 = r32199 / r32204;
double r32206 = r32205 * r32203;
return r32206;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.5
Taylor expanded around inf 12.5
Simplified8.9
rmApplied div-inv8.9
Applied associate-*l*9.0
Simplified8.9
rmApplied *-un-lft-identity8.9
Applied *-un-lft-identity8.9
Applied times-frac8.9
Simplified8.9
Final simplification8.9
herbie shell --seed 2019322 +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)))