\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\sin th \cdot \frac{\sin ky}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(\sin ky, \sin kx\right)\right)\right)}double f(double kx, double ky, double th) {
double r535737 = ky;
double r535738 = sin(r535737);
double r535739 = kx;
double r535740 = sin(r535739);
double r535741 = 2.0;
double r535742 = pow(r535740, r535741);
double r535743 = pow(r535738, r535741);
double r535744 = r535742 + r535743;
double r535745 = sqrt(r535744);
double r535746 = r535738 / r535745;
double r535747 = th;
double r535748 = sin(r535747);
double r535749 = r535746 * r535748;
return r535749;
}
double f(double kx, double ky, double th) {
double r535750 = th;
double r535751 = sin(r535750);
double r535752 = ky;
double r535753 = sin(r535752);
double r535754 = kx;
double r535755 = sin(r535754);
double r535756 = hypot(r535753, r535755);
double r535757 = log1p(r535756);
double r535758 = expm1(r535757);
double r535759 = r535753 / r535758;
double r535760 = r535751 * r535759;
return r535760;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.1
Simplified8.7
rmApplied expm1-log1p-u8.8
Final simplification8.8
herbie shell --seed 2019149 +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)))