\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 \leq -1.3366524590649154 \cdot 10^{+154}:\\
\;\;\;\;\left(\frac{1}{\left(F \cdot F\right) \cdot \sin B} - \frac{1}{\sin B}\right) - \frac{1}{\frac{\tan B}{x}}\\
\mathbf{elif}\;F \leq 827777.6737999358:\\
\;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\left(F \cdot F\right) \cdot \sin B}\right) - \frac{x}{\tan B}\\
\end{array}(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(FPCore (F B x)
:precision binary64
(if (<= F -1.3366524590649154e+154)
(- (- (/ 1.0 (* (* F F) (sin B))) (/ 1.0 (sin B))) (/ 1.0 (/ (tan B) x)))
(if (<= F 827777.6737999358)
(-
(/ (* F (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) (sin B))
(/ x (tan B)))
(- (- (/ 1.0 (sin B)) (/ 1.0 (* (* F F) (sin B)))) (/ x (tan B))))))double code(double F, double B, double x) {
return ((double) (((double) -(((double) (x * (1.0 / ((double) tan(B))))))) + ((double) ((F / ((double) sin(B))) * ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (2.0 * x)))), ((double) -((1.0 / 2.0)))))))));
}
double code(double F, double B, double x) {
double tmp;
if ((F <= -1.3366524590649154e+154)) {
tmp = ((double) (((double) ((1.0 / ((double) (((double) (F * F)) * ((double) sin(B))))) - (1.0 / ((double) sin(B))))) - (1.0 / (((double) tan(B)) / x))));
} else {
double tmp_1;
if ((F <= 827777.6737999358)) {
tmp_1 = ((double) ((((double) (F * ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (x * 2.0)))), -0.5)))) / ((double) sin(B))) - (x / ((double) tan(B)))));
} else {
tmp_1 = ((double) (((double) ((1.0 / ((double) sin(B))) - (1.0 / ((double) (((double) (F * F)) * ((double) sin(B))))))) - (x / ((double) tan(B)))));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -1.33665245906491536e154Initial program 39.4
Simplified39.4
rmApplied clear-num_binary6439.4
Taylor expanded around -inf 0.2
Simplified0.2
if -1.33665245906491536e154 < F < 827777.673799935845Initial program 1.7
Simplified1.6
rmApplied associate-*l/_binary640.3
Simplified0.3
if 827777.673799935845 < F Initial program 26.5
Simplified26.5
Taylor expanded around inf 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020210
(FPCore (F B x)
:name "VandenBroeck and Keller, Equation (23)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))