\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\mathsf{log1p}\left(\mathsf{expm1}\left(\sin ky \cdot \frac{\sin th}{\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 code(double kx, double ky, double th) {
return ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th));
}
double code(double kx, double ky, double th) {
return log1p(expm1((sin(ky) * (sin(th) / hypot(pow(sin(kx), (2.0 / 2.0)), pow(sin(ky), (2.0 / 2.0)))))));
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 4.0
rmApplied sqr-pow4.0
Applied sqr-pow4.0
Applied hypot-def0.2
rmApplied div-inv0.3
Applied associate-*l*0.4
Simplified0.2
rmApplied log1p-expm1-u0.3
Final simplification0.3
herbie shell --seed 2020066 +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)))