\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\sin ky \cdot \frac{\sin th}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left({\left(\sin kx\right)}^{\left(\frac{2}{2}\right)}, {\left(\sin ky\right)}^{\left(\frac{2}{2}\right)}\right)\right)\right)}double f(double kx, double ky, double th) {
double r47395 = ky;
double r47396 = sin(r47395);
double r47397 = kx;
double r47398 = sin(r47397);
double r47399 = 2.0;
double r47400 = pow(r47398, r47399);
double r47401 = pow(r47396, r47399);
double r47402 = r47400 + r47401;
double r47403 = sqrt(r47402);
double r47404 = r47396 / r47403;
double r47405 = th;
double r47406 = sin(r47405);
double r47407 = r47404 * r47406;
return r47407;
}
double f(double kx, double ky, double th) {
double r47408 = ky;
double r47409 = sin(r47408);
double r47410 = th;
double r47411 = sin(r47410);
double r47412 = kx;
double r47413 = sin(r47412);
double r47414 = 2.0;
double r47415 = 2.0;
double r47416 = r47414 / r47415;
double r47417 = pow(r47413, r47416);
double r47418 = pow(r47409, r47416);
double r47419 = hypot(r47417, r47418);
double r47420 = log1p(r47419);
double r47421 = expm1(r47420);
double r47422 = r47411 / r47421;
double r47423 = r47409 * r47422;
return r47423;
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 12.5
rmApplied sqr-pow12.5
Applied sqr-pow12.5
Applied hypot-def8.7
rmApplied div-inv8.8
Applied associate-*l*8.9
Simplified8.8
rmApplied expm1-log1p-u8.9
Final simplification8.9
herbie shell --seed 2019305 +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)))