\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\begin{array}{l}
\mathbf{if}\;F \le -4.05277955621971414 \cdot 10^{68}:\\
\;\;\;\;\mathsf{fma}\left(1, \frac{x}{\sin B \cdot {F}^{2}}, -\mathsf{fma}\left(1, \frac{x \cdot \cos B}{\sin B}, \frac{1}{\sin B}\right)\right)\\
\mathbf{elif}\;F \le 510104655.935105622:\\
\;\;\;\;\mathsf{fma}\left(F \cdot \frac{1}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, -\frac{x \cdot 1}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\sin B} + \frac{x}{\sin B \cdot {F}^{2}}, \frac{1}{\sin B}\right)\\
\end{array}double code(double F, double B, double x) {
return (-(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))));
}
double code(double F, double B, double x) {
double VAR;
if ((F <= -4.052779556219714e+68)) {
VAR = fma(1.0, (x / (sin(B) * pow(F, 2.0))), -fma(1.0, ((x * cos(B)) / sin(B)), (1.0 / sin(B))));
} else {
double VAR_1;
if ((F <= 510104655.9351056)) {
VAR_1 = fma((F * (1.0 / sin(B))), pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)), -((x * 1.0) / tan(B)));
} else {
VAR_1 = fma(-1.0, (((x * cos(B)) / sin(B)) + (x / (sin(B) * pow(F, 2.0)))), (1.0 / sin(B)));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -4.052779556219714e+68Initial program 30.2
Simplified30.2
Taylor expanded around -inf 0.2
Simplified0.2
if -4.052779556219714e+68 < F < 510104655.9351056Initial program 0.6
Simplified0.6
rmApplied associate-*r/0.5
rmApplied div-inv0.5
if 510104655.9351056 < F Initial program 25.2
Simplified25.2
Taylor expanded around inf 0.2
Simplified0.2
Final simplification0.3
herbie shell --seed 2020102 +o rules:numerics
(FPCore (F B x)
:name "VandenBroeck and Keller, Equation (23)"
:precision binary64
(+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))