\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 -7.39940744743415903 \cdot 10^{52}:\\
\;\;\;\;\frac{\frac{\frac{1}{F}}{F} - 1}{\sin B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \le 244697.137374221085:\\
\;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \frac{\frac{1}{F}}{F}}{\sin B} - \frac{x \cdot 1}{\tan B}\\
\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 <= -7.399407447434159e+52)) {
VAR = (((((1.0 / F) / F) - 1.0) / sin(B)) - (x * (1.0 / tan(B))));
} else {
double VAR_1;
if ((F <= 244697.13737422109)) {
VAR_1 = (((F * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) / sin(B)) - (1.0 / (tan(B) / (x * 1.0))));
} else {
VAR_1 = (((1.0 - ((1.0 / F) / F)) / sin(B)) - ((x * 1.0) / tan(B)));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -7.399407447434159e+52Initial program 29.2
Simplified29.2
rmApplied associate-*l/23.0
Taylor expanded around -inf 0.2
Simplified0.2
if -7.399407447434159e+52 < F < 244697.13737422109Initial program 0.6
Simplified0.6
rmApplied associate-*l/0.4
rmApplied associate-*r/0.3
rmApplied clear-num0.4
if 244697.13737422109 < F Initial program 25.7
Simplified25.7
rmApplied associate-*l/19.4
rmApplied associate-*r/19.3
Taylor expanded around inf 0.1
Simplified0.1
Final simplification0.3
herbie shell --seed 2020091
(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))))))