\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 r49732 = ky;
double r49733 = sin(r49732);
double r49734 = kx;
double r49735 = sin(r49734);
double r49736 = 2.0;
double r49737 = pow(r49735, r49736);
double r49738 = pow(r49733, r49736);
double r49739 = r49737 + r49738;
double r49740 = sqrt(r49739);
double r49741 = r49733 / r49740;
double r49742 = th;
double r49743 = sin(r49742);
double r49744 = r49741 * r49743;
return r49744;
}
double f(double kx, double ky, double th) {
double r49745 = ky;
double r49746 = sin(r49745);
double r49747 = th;
double r49748 = sin(r49747);
double r49749 = kx;
double r49750 = sin(r49749);
double r49751 = 2.0;
double r49752 = 2.0;
double r49753 = r49751 / r49752;
double r49754 = pow(r49750, r49753);
double r49755 = pow(r49746, r49753);
double r49756 = hypot(r49754, r49755);
double r49757 = r49748 / r49756;
double r49758 = r49746 * r49757;
return r49758;
}



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.9
rmApplied div-inv9.0
Applied associate-*l*9.1
Simplified9.0
rmApplied add-sqr-sqrt9.2
Applied associate-/r*9.2
rmApplied *-un-lft-identity9.2
Applied associate-*l*9.2
Simplified9.0
Final simplification9.0
herbie shell --seed 2019306 +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)))