\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 -282918228819822380000:\\
\;\;\;\;\left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)\\
\mathbf{elif}\;F \le 120765522752324900:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\sin B}{F}}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, -\frac{x \cdot 1}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right) + \left(-\frac{x \cdot 1}{\tan B}\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 temp;
if ((F <= -2.8291822881982238e+20)) {
temp = (((1.0 * (1.0 / (sin(B) * pow(F, 2.0)))) - (1.0 / sin(B))) + -((x * 1.0) / tan(B)));
} else {
double temp_1;
if ((F <= 1.207655227523249e+17)) {
temp_1 = fma((1.0 / (sin(B) / F)), pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)), -((x * 1.0) / tan(B)));
} else {
temp_1 = (((1.0 / sin(B)) - (1.0 * (1.0 / (sin(B) * pow(F, 2.0))))) + -((x * 1.0) / tan(B)));
}
temp = temp_1;
}
return temp;
}



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -2.8291822881982238e+20Initial program 25.3
Simplified25.3
rmApplied associate-*r/25.2
rmApplied clear-num25.2
rmApplied fma-udef25.2
Simplified19.5
Taylor expanded around -inf 0.1
if -2.8291822881982238e+20 < F < 1.207655227523249e+17Initial program 0.4
Simplified0.4
rmApplied associate-*r/0.3
rmApplied clear-num0.4
if 1.207655227523249e+17 < F Initial program 26.9
Simplified26.9
rmApplied associate-*r/26.8
rmApplied clear-num26.8
rmApplied fma-udef26.8
Simplified21.3
Taylor expanded around inf 0.2
Final simplification0.2
herbie shell --seed 2020060 +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))))))