\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 -1.0328200120067305 \cdot 10^{162}:\\
\;\;\;\;\frac{\frac{\frac{1}{F}}{F} - 1}{\sin B} - \frac{x \cdot 1}{\tan B}\\
\mathbf{elif}\;F \le 3.06813447084506089 \cdot 10^{147}:\\
\;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \left(\frac{1}{F} - 1 \cdot \frac{1}{{F}^{3}}\right)}{\sin B} - \frac{x \cdot 1}{\tan B}\\
\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 <= -1.0328200120067305e+162)) {
VAR = ((double) (((double) (((double) (((double) (((double) (1.0 / F)) / F)) - 1.0)) / ((double) sin(B)))) - ((double) (((double) (x * 1.0)) / ((double) tan(B))))));
} else {
double VAR_1;
if ((F <= 3.068134470845061e+147)) {
VAR_1 = ((double) (((double) (((double) (F / ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (2.0 * x)))), ((double) (1.0 / 2.0)))))) / ((double) sin(B)))) - ((double) (((double) (x * 1.0)) / ((double) tan(B))))));
} else {
VAR_1 = ((double) (((double) (((double) (F * ((double) (((double) (1.0 / F)) - ((double) (1.0 * ((double) (1.0 / ((double) pow(F, 3.0)))))))))) / ((double) sin(B)))) - ((double) (((double) (x * 1.0)) / ((double) tan(B))))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -1.0328200120067305e+162Initial program 42.0
Simplified42.0
rmApplied associate-*l/36.2
rmApplied associate-*r/36.1
Taylor expanded around -inf 0.1
Simplified0.1
if -1.0328200120067305e+162 < F < 3.068134470845061e+147Initial program 2.8
Simplified2.8
rmApplied associate-*l/0.8
rmApplied associate-*r/0.7
rmApplied pow-neg0.7
Applied un-div-inv0.7
if 3.068134470845061e+147 < F Initial program 39.2
Simplified39.2
rmApplied associate-*l/33.1
rmApplied associate-*r/33.0
Taylor expanded around inf 0.2
Final simplification0.5
herbie shell --seed 2020122
(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))))))