\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\left(\sin kx\right), \left(\sin ky\right)\right)}\right)\right)\right)\right)double f(double kx, double ky, double th) {
double r692913 = ky;
double r692914 = sin(r692913);
double r692915 = kx;
double r692916 = sin(r692915);
double r692917 = 2.0;
double r692918 = pow(r692916, r692917);
double r692919 = pow(r692914, r692917);
double r692920 = r692918 + r692919;
double r692921 = sqrt(r692920);
double r692922 = r692914 / r692921;
double r692923 = th;
double r692924 = sin(r692923);
double r692925 = r692922 * r692924;
return r692925;
}
double f(double kx, double ky, double th) {
double r692926 = th;
double r692927 = sin(r692926);
double r692928 = ky;
double r692929 = sin(r692928);
double r692930 = kx;
double r692931 = sin(r692930);
double r692932 = hypot(r692931, r692929);
double r692933 = r692929 / r692932;
double r692934 = r692927 * r692933;
double r692935 = log1p(r692934);
double r692936 = expm1(r692935);
return r692936;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.5
Simplified9.0
rmApplied *-commutative9.0
rmApplied log1p-expm1-u9.0
rmApplied expm1-log1p-u9.0
Simplified9.0
rmApplied expm1-log1p-u9.1
Simplified9.0
Final simplification9.0
herbie shell --seed 2019133 +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)))