\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 -5.94905980657102 \cdot 10^{+100}:\\
\;\;\;\;\left(\frac{1}{\left(F \cdot F\right) \cdot \sin B} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 46213591011832264:\\
\;\;\;\;F \cdot \frac{{\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}{\sin B} \cdot \cos 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 -5.94905980657102e+100)
(- (- (/ 1.0 (* (* F F) (sin B))) (/ 1.0 (sin B))) (/ x (tan B)))
(if (<= F 46213591011832264.0)
(-
(* 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 (sin B)) (cos 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 <= -5.94905980657102e+100)) {
tmp = ((double) (((double) ((1.0 / ((double) (((double) (F * F)) * ((double) sin(B))))) - (1.0 / ((double) sin(B))))) - (x / ((double) tan(B)))));
} else {
double tmp_1;
if ((F <= 46213591011832264.0)) {
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))))))) - ((double) ((x / ((double) sin(B))) * ((double) cos(B))))));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -5.94905980657102037e100Initial program 35.8
Simplified35.7
Taylor expanded around -inf 0.1
Simplified0.1
if -5.94905980657102037e100 < F < 46213591011832264Initial program 0.8
Simplified0.7
rmApplied div-inv_binary640.7
Applied associate-*l*_binary640.3
Simplified0.3
if 46213591011832264 < F Initial program 26.7
Simplified26.7
rmApplied tan-quot_binary6426.7
Applied associate-/r/_binary6426.7
Taylor expanded around inf 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020219
(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))))))