\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 -8.41757921268486155 \cdot 10^{145}:\\
\;\;\;\;\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 4304957722136079.5:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\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 ((double) (((double) -(((double) (x * ((double) (1.0 / ((double) tan(B)))))))) + ((double) (((double) (F / ((double) sin(B)))) * ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (2.0 * x)))), ((double) -(((double) (1.0 / 2.0))))))))));
}
double code(double F, double B, double x) {
double VAR;
if ((F <= -8.417579212684862e+145)) {
VAR = ((double) fma(1.0, ((double) (x / ((double) (((double) sin(B)) * ((double) pow(F, 2.0)))))), ((double) -(((double) fma(1.0, ((double) (((double) (x * ((double) cos(B)))) / ((double) sin(B)))), ((double) (1.0 / ((double) sin(B))))))))));
} else {
double VAR_1;
if ((F <= 4304957722136079.5)) {
VAR_1 = ((double) fma(((double) (F / ((double) sin(B)))), ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (2.0 * x)))), ((double) -(((double) (1.0 / 2.0)))))), ((double) -(((double) (((double) (x * 1.0)) / ((double) tan(B))))))));
} else {
VAR_1 = ((double) fma(((double) -(1.0)), ((double) (((double) (((double) (x * ((double) cos(B)))) / ((double) sin(B)))) + ((double) (x / ((double) (((double) sin(B)) * ((double) pow(F, 2.0)))))))), ((double) (1.0 / ((double) sin(B))))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -8.417579212684862e+145Initial program 40.3
Simplified40.3
Taylor expanded around -inf 0.2
Simplified0.2
if -8.417579212684862e+145 < F < 4304957722136079.5Initial program 1.6
Simplified1.5
rmApplied associate-*r/1.5
if 4304957722136079.5 < F Initial program 24.3
Simplified24.3
Taylor expanded around inf 0.2
Simplified0.2
Final simplification0.9
herbie shell --seed 2020123 +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))))))