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



Bits error versus F



Bits error versus B



Bits error versus x
Results
if F < -4.7370863933049426e+91Initial program 32.6
Simplified32.6
Taylor expanded around -inf 0.2
Simplified0.2
if -4.7370863933049426e+91 < F < 125389888783.81546Initial program 0.8
Simplified0.8
rmApplied associate-*r/0.7
rmApplied sqr-pow0.8
Simplified0.8
Simplified0.8
rmApplied fma-udef0.8
Simplified0.3
if 125389888783.81546 < F Initial program 26.1
Simplified26.1
Taylor expanded around inf 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020053 +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))))))