\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\left(-\frac{\sin ky}{-\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right) \cdot \sin th
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
(FPCore (kx ky th) :precision binary64 (* (- (/ (sin ky) (- (hypot (sin ky) (sin kx))))) (sin th)))
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 -(sin(ky) / -hypot(sin(ky), sin(kx))) * sin(th);
}



Bits error versus kx



Bits error versus ky



Bits error versus th
Results
Initial program 4.0
Simplified0.2
rmApplied add-sqr-sqrt_binary640.6
Simplified0.6
Simplified0.6
rmApplied frac-2neg_binary640.6
Applied distribute-frac-neg_binary640.6
Simplified0.2
Final simplification0.2
herbie shell --seed 2021211
(FPCore (kx ky th)
:name "Toniolo and Linder, Equation (3b), real"
:precision binary64
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))