\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\sin th \cdot \mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(\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 r1534177 = ky;
double r1534178 = sin(r1534177);
double r1534179 = kx;
double r1534180 = sin(r1534179);
double r1534181 = 2.0;
double r1534182 = pow(r1534180, r1534181);
double r1534183 = pow(r1534178, r1534181);
double r1534184 = r1534182 + r1534183;
double r1534185 = sqrt(r1534184);
double r1534186 = r1534178 / r1534185;
double r1534187 = th;
double r1534188 = sin(r1534187);
double r1534189 = r1534186 * r1534188;
return r1534189;
}
double f(double kx, double ky, double th) {
double r1534190 = th;
double r1534191 = sin(r1534190);
double r1534192 = ky;
double r1534193 = sin(r1534192);
double r1534194 = kx;
double r1534195 = sin(r1534194);
double r1534196 = hypot(r1534195, r1534193);
double r1534197 = r1534193 / r1534196;
double r1534198 = expm1(r1534197);
double r1534199 = log1p(r1534198);
double r1534200 = r1534191 * r1534199;
return r1534200;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.4
Simplified11.2
rmApplied *-un-lft-identity11.2
Applied times-frac8.5
Simplified8.5
rmApplied expm1-log1p-u8.7
rmApplied expm1-log1p-u10.0
Simplified8.6
rmApplied log1p-expm1-u8.6
Simplified8.6
Final simplification8.6
herbie shell --seed 2019125 +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)))