\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 -64003883249.95031:\\
\;\;\;\;\frac{1}{-\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.9689563051736543 \cdot 10^{+26}:\\
\;\;\;\;\left(F \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right) \cdot \frac{\sqrt[3]{1}}{\frac{\sin B}{{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5}}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \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 -64003883249.95031)
(- (/ 1.0 (- (sin B))) (/ x (tan B)))
(if (<= F 1.9689563051736543e+26)
(-
(*
(* F (* (cbrt 1.0) (cbrt 1.0)))
(/ (cbrt 1.0) (/ (sin B) (pow (+ (* x 2.0) (+ 2.0 (* F F))) -0.5))))
(/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x (tan B))))))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 tmp;
if (F <= -64003883249.95031) {
tmp = (1.0 / -sin(B)) - (x / tan(B));
} else if (F <= 1.9689563051736543e+26) {
tmp = ((F * (cbrt(1.0) * cbrt(1.0))) * (cbrt(1.0) / (sin(B) / pow(((x * 2.0) + (2.0 + (F * F))), -0.5)))) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -64003883249.9503098Initial program 25.8
Simplified25.8
rmApplied associate-*l/_binary6419.8
Simplified19.8
rmApplied clear-num_binary6419.9
Simplified19.9
Taylor expanded around -inf 0.2
Simplified0.2
if -64003883249.9503098 < F < 1.9689563051736543e26Initial program 0.4
Simplified0.3
rmApplied associate-*l/_binary640.3
Simplified0.3
rmApplied clear-num_binary640.3
Simplified0.3
rmApplied *-un-lft-identity_binary640.3
Applied times-frac_binary640.3
Applied add-cube-cbrt_binary640.3
Applied times-frac_binary640.3
Simplified0.3
Simplified0.3
if 1.9689563051736543e26 < F Initial program 27.8
Simplified27.7
Taylor expanded around inf 0.2
Final simplification0.2
herbie shell --seed 2021113
(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))))))