\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 -5.3283418629425839 \cdot 10^{154}:\\
\;\;\;\;\left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \le 6.30796157978636796:\\
\;\;\;\;\frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right) - \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 <= -5.328341862942584e+154)) {
VAR = (((1.0 * (1.0 / (sin(B) * pow(F, 2.0)))) - (1.0 / sin(B))) - (x * (1.0 / tan(B))));
} else {
double VAR_1;
if ((F <= 6.307961579786368)) {
VAR_1 = ((F / (sin(B) * pow((((F * F) + 2.0) + (2.0 * x)), (1.0 / 2.0)))) - ((x * 1.0) / tan(B)));
} else {
VAR_1 = (((1.0 / sin(B)) - (1.0 * (1.0 / (sin(B) * pow(F, 2.0))))) - ((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 < -5.328341862942584e+154Initial program 42.2
Simplified42.2
Taylor expanded around -inf 0.2
if -5.328341862942584e+154 < F < 6.307961579786368Initial program 1.7
Simplified1.7
rmApplied pow-neg1.7
Applied frac-times0.4
Simplified0.4
rmApplied associate-*r/0.3
if 6.307961579786368 < F Initial program 24.8
Simplified24.8
rmApplied pow-neg24.8
Applied frac-times18.7
Simplified18.7
rmApplied associate-*r/18.6
Taylor expanded around inf 0.3
Final simplification0.3
herbie shell --seed 2020102
(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))))))