\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 -12552003.890338559:\\
\;\;\;\;\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 243770.401424761483:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - 1 \cdot \frac{x \cdot \cos B}{\sin 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 ((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 <= -12552003.890338559)) {
VAR = ((double) (((double) (((double) (1.0 * ((double) (1.0 / ((double) (((double) sin(B)) * ((double) pow(F, 2.0)))))))) - ((double) (1.0 / ((double) sin(B)))))) - ((double) (x * ((double) (1.0 / ((double) tan(B))))))));
} else {
double VAR_1;
if ((F <= 243770.40142476148)) {
VAR_1 = ((double) (((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) (1.0 * ((double) (((double) (x * ((double) cos(B)))) / ((double) sin(B))))))));
} else {
VAR_1 = ((double) (((double) (((double) (1.0 / ((double) sin(B)))) - ((double) (1.0 * ((double) (1.0 / ((double) (((double) sin(B)) * ((double) pow(F, 2.0)))))))))) - ((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 < -12552003.890338559Initial program 25.1
Simplified25.1
Taylor expanded around -inf 0.2
if -12552003.890338559 < F < 243770.40142476148Initial program 0.4
Simplified0.4
Taylor expanded around inf 0.4
if 243770.40142476148 < F Initial program 23.7
Simplified23.7
rmApplied div-inv23.7
Applied associate-*l*18.6
Simplified18.6
rmApplied associate-*r/18.6
Taylor expanded around inf 0.2
Final simplification0.3
herbie shell --seed 2020123
(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))))))