\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left({\left(\sin kx\right)}^{\left(\frac{2}{2}\right)}, {\left(\sin ky\right)}^{\left(\frac{2}{2}\right)}\right)}double f(double kx, double ky, double th) {
double r54017 = ky;
double r54018 = sin(r54017);
double r54019 = kx;
double r54020 = sin(r54019);
double r54021 = 2.0;
double r54022 = pow(r54020, r54021);
double r54023 = pow(r54018, r54021);
double r54024 = r54022 + r54023;
double r54025 = sqrt(r54024);
double r54026 = r54018 / r54025;
double r54027 = th;
double r54028 = sin(r54027);
double r54029 = r54026 * r54028;
return r54029;
}
double f(double kx, double ky, double th) {
double r54030 = ky;
double r54031 = sin(r54030);
double r54032 = th;
double r54033 = sin(r54032);
double r54034 = kx;
double r54035 = sin(r54034);
double r54036 = 2.0;
double r54037 = 2.0;
double r54038 = r54036 / r54037;
double r54039 = pow(r54035, r54038);
double r54040 = pow(r54031, r54038);
double r54041 = hypot(r54039, r54040);
double r54042 = r54033 / r54041;
double r54043 = r54031 * r54042;
return r54043;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.5
rmApplied sqr-pow12.5
Applied sqr-pow12.5
Applied hypot-def8.7
rmApplied div-inv8.8
Applied associate-*l*8.8
Simplified8.7
Final simplification8.7
herbie shell --seed 2020042 +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)))