\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.34756701151211015 \cdot 10^{155}:\\
\;\;\;\;\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 464708565449560:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \cdot \frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{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 VAR;
if ((F <= -1.3475670115121101e+155)) {
VAR = (-((x * 1.0) / tan(B)) + ((1.0 * (1.0 / (sin(B) * pow(F, 2.0)))) - (1.0 / sin(B))));
} else {
double VAR_1;
if ((F <= 4.6470856544956e+14)) {
VAR_1 = (-((x * 1.0) / tan(B)) + ((1.0 / sin(B)) * (F / pow((((F * F) + 2.0) + (2.0 * x)), (1.0 / 2.0)))));
} else {
VAR_1 = (-(x * (1.0 / tan(B))) + ((1.0 / sin(B)) - (1.0 * (1.0 / (sin(B) * pow(F, 2.0))))));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -1.3475670115121101e+155Initial program 41.2
rmApplied pow-neg41.2
Applied frac-times36.3
Simplified36.3
rmApplied associate-*r/36.2
Taylor expanded around -inf 0.1
if -1.3475670115121101e+155 < F < 4.6470856544956e+14Initial program 1.7
rmApplied pow-neg1.7
Applied frac-times0.5
Simplified0.5
rmApplied associate-*r/0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
if 4.6470856544956e+14 < F Initial program 26.8
Taylor expanded around inf 0.2
Final simplification0.3
herbie shell --seed 2020078 +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))))))