\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\mathsf{fma}\left(1, \frac{1}{\sin B}, -\frac{x}{\tan B}\right)
(FPCore (B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
(FPCore (B x) :precision binary64 (fma 1.0 (/ 1.0 (sin B)) (- (/ x (tan B)))))
double code(double B, double x) {
return -(x * (1.0 / tan(B))) + (1.0 / sin(B));
}
double code(double B, double x) {
return fma(1.0, (1.0 / sin(B)), -(x / tan(B)));
}



Bits error versus B



Bits error versus x
Initial program 0.2
Simplified0.1
Applied *-un-lft-identity_binary640.1
Applied fma-neg_binary640.1
Final simplification0.1
herbie shell --seed 2022125
(FPCore (B x)
:name "VandenBroeck and Keller, Equation (24)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))