\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\frac{\sin th}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}double f(double kx, double ky, double th) {
double r38133 = ky;
double r38134 = sin(r38133);
double r38135 = kx;
double r38136 = sin(r38135);
double r38137 = 2.0;
double r38138 = pow(r38136, r38137);
double r38139 = pow(r38134, r38137);
double r38140 = r38138 + r38139;
double r38141 = sqrt(r38140);
double r38142 = r38134 / r38141;
double r38143 = th;
double r38144 = sin(r38143);
double r38145 = r38142 * r38144;
return r38145;
}
double f(double kx, double ky, double th) {
double r38146 = th;
double r38147 = sin(r38146);
double r38148 = ky;
double r38149 = sin(r38148);
double r38150 = kx;
double r38151 = sin(r38150);
double r38152 = hypot(r38149, r38151);
double r38153 = sqrt(r38152);
double r38154 = r38147 / r38153;
double r38155 = r38149 / r38153;
double r38156 = r38154 * r38155;
return r38156;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.3
Taylor expanded around inf 12.3
Simplified8.6
rmApplied *-commutative8.6
rmApplied add-sqr-sqrt8.9
Applied *-un-lft-identity8.9
Applied times-frac9.0
Applied associate-*r*9.0
Simplified8.9
Final simplification8.9
herbie shell --seed 2019352 +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)))