\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(\frac{\sin th}{\frac{\mathsf{hypot}\left(\left(\sin kx\right), \left(\sin ky\right)\right)}{\sin ky}}\right)\right)\right)\right)double f(double kx, double ky, double th) {
double r738723 = ky;
double r738724 = sin(r738723);
double r738725 = kx;
double r738726 = sin(r738725);
double r738727 = 2.0;
double r738728 = pow(r738726, r738727);
double r738729 = pow(r738724, r738727);
double r738730 = r738728 + r738729;
double r738731 = sqrt(r738730);
double r738732 = r738724 / r738731;
double r738733 = th;
double r738734 = sin(r738733);
double r738735 = r738732 * r738734;
return r738735;
}
double f(double kx, double ky, double th) {
double r738736 = th;
double r738737 = sin(r738736);
double r738738 = kx;
double r738739 = sin(r738738);
double r738740 = ky;
double r738741 = sin(r738740);
double r738742 = hypot(r738739, r738741);
double r738743 = r738742 / r738741;
double r738744 = r738737 / r738743;
double r738745 = log1p(r738744);
double r738746 = expm1(r738745);
return r738746;
}



Bits error versus kx



Bits error versus ky



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