\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}}double f(double kx, double ky, double th) {
double r35113 = ky;
double r35114 = sin(r35113);
double r35115 = kx;
double r35116 = sin(r35115);
double r35117 = 2.0;
double r35118 = pow(r35116, r35117);
double r35119 = pow(r35114, r35117);
double r35120 = r35118 + r35119;
double r35121 = sqrt(r35120);
double r35122 = r35114 / r35121;
double r35123 = th;
double r35124 = sin(r35123);
double r35125 = r35122 * r35124;
return r35125;
}
double f(double kx, double ky, double th) {
double r35126 = th;
double r35127 = sin(r35126);
double r35128 = kx;
double r35129 = sin(r35128);
double r35130 = ky;
double r35131 = sin(r35130);
double r35132 = hypot(r35129, r35131);
double r35133 = r35132 / r35131;
double r35134 = r35127 / r35133;
return r35134;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.6
Taylor expanded around inf 12.6
Simplified9.0
rmApplied clear-num9.0
rmApplied *-un-lft-identity9.0
Applied *-un-lft-identity9.0
Applied times-frac9.0
Applied associate-*l*9.0
Simplified9.0
Final simplification9.0
herbie shell --seed 2019304 +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)))