\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\frac{\sin th}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}double f(double kx, double ky, double th) {
double r542256 = ky;
double r542257 = sin(r542256);
double r542258 = kx;
double r542259 = sin(r542258);
double r542260 = 2.0;
double r542261 = pow(r542259, r542260);
double r542262 = pow(r542257, r542260);
double r542263 = r542261 + r542262;
double r542264 = sqrt(r542263);
double r542265 = r542257 / r542264;
double r542266 = th;
double r542267 = sin(r542266);
double r542268 = r542265 * r542267;
return r542268;
}
double f(double kx, double ky, double th) {
double r542269 = th;
double r542270 = sin(r542269);
double r542271 = 1.0;
double r542272 = ky;
double r542273 = sin(r542272);
double r542274 = kx;
double r542275 = sin(r542274);
double r542276 = hypot(r542273, r542275);
double r542277 = r542273 / r542276;
double r542278 = r542271 / r542277;
double r542279 = r542270 / r542278;
return r542279;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.0
Simplified8.5
rmApplied *-un-lft-identity8.5
Applied associate-/l*8.5
rmApplied associate-*r/8.5
Simplified8.5
rmApplied clear-num8.5
Final simplification8.5
herbie shell --seed 2019151 +o rules:numerics
(FPCore (kx ky th)
:name "Toniolo and Linder, Equation (3b), real"
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))