\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\frac{\sin ky}{\frac{\mathsf{hypot}\left(\left(\sin kx\right), \left(\sin ky\right)\right)}{\sin th}}double f(double kx, double ky, double th) {
double r537794 = ky;
double r537795 = sin(r537794);
double r537796 = kx;
double r537797 = sin(r537796);
double r537798 = 2.0;
double r537799 = pow(r537797, r537798);
double r537800 = pow(r537795, r537798);
double r537801 = r537799 + r537800;
double r537802 = sqrt(r537801);
double r537803 = r537795 / r537802;
double r537804 = th;
double r537805 = sin(r537804);
double r537806 = r537803 * r537805;
return r537806;
}
double f(double kx, double ky, double th) {
double r537807 = ky;
double r537808 = sin(r537807);
double r537809 = kx;
double r537810 = sin(r537809);
double r537811 = hypot(r537810, r537808);
double r537812 = th;
double r537813 = sin(r537812);
double r537814 = r537811 / r537813;
double r537815 = r537808 / r537814;
return r537815;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.2
Simplified8.5
rmApplied *-commutative8.5
rmApplied div-inv8.6
Applied associate-*l*8.7
Simplified8.5
rmApplied log1p-expm1-u8.6
rmApplied *-un-lft-identity8.6
Applied associate-*l*8.6
Simplified8.5
Final simplification8.5
herbie shell --seed 2019132 +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)))