\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 -5085.08685709284964:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\
\mathbf{elif}\;F \le 6.4254080033758032 \cdot 10^{-4}:\\
\;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\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 temp;
if ((F <= -5085.08685709285)) {
temp = (-((x * 1.0) / tan(B)) + ((1.0 * (1.0 / (sin(B) * pow(F, 2.0)))) - (1.0 / sin(B))));
} else {
double temp_1;
if ((F <= 0.0006425408003375803)) {
temp_1 = (-(1.0 * ((x * cos(B)) / sin(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))));
} else {
temp_1 = (-((x * 1.0) / tan(B)) + ((1.0 / sin(B)) - (1.0 * (1.0 / (sin(B) * pow(F, 2.0))))));
}
temp = temp_1;
}
return temp;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -5085.08685709285Initial program 25.1
rmApplied pow-neg25.1
Applied frac-times18.9
Simplified18.9
rmApplied associate-*r/18.9
Taylor expanded around -inf 0.2
if -5085.08685709285 < F < 0.0006425408003375803Initial program 0.4
Taylor expanded around inf 0.3
if 0.0006425408003375803 < F Initial program 23.7
rmApplied pow-neg23.7
Applied frac-times18.9
Simplified18.9
rmApplied associate-*r/18.8
Taylor expanded around inf 0.9
Final simplification0.4
herbie shell --seed 2020065 +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))))))