Average Error: 13.5 → 0.2
Time: 11.7s
Precision: 64
\[\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 -1.36681100122314579 \cdot 10^{154}:\\ \;\;\;\;\frac{\frac{\frac{1}{F}}{F} - 1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \le 2.90899931611222616 \cdot 10^{32}:\\ \;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{\frac{1}{F}}{F}}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array}\]
\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 -1.36681100122314579 \cdot 10^{154}:\\
\;\;\;\;\frac{\frac{\frac{1}{F}}{F} - 1}{\sin B} - x \cdot \frac{1}{\tan B}\\

\mathbf{elif}\;F \le 2.90899931611222616 \cdot 10^{32}:\\
\;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \frac{\frac{1}{F}}{F}}{\sin B} - x \cdot \frac{1}{\tan B}\\

\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 VAR;
	if ((F <= -1.3668110012231458e+154)) {
		VAR = (((((1.0 / F) / F) - 1.0) / sin(B)) - (x * (1.0 / tan(B))));
	} else {
		double VAR_1;
		if ((F <= 2.908999316112226e+32)) {
			VAR_1 = (((F / pow((((F * F) + 2.0) + (2.0 * x)), (1.0 / 2.0))) / sin(B)) - ((x * 1.0) / tan(B)));
		} else {
			VAR_1 = (((1.0 - ((1.0 / F) / F)) / sin(B)) - (x * (1.0 / tan(B))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if F < -1.3668110012231458e+154

    1. Initial program 41.8

      \[\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)}\]
    2. Simplified41.8

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-*l/36.2

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B}\]
    5. Taylor expanded around -inf 0.2

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{1}{{F}^{2}} - 1}}{\sin B} - x \cdot \frac{1}{\tan B}\]
    6. Simplified0.2

      \[\leadsto \frac{\color{blue}{\frac{\frac{1}{F}}{F} - 1}}{\sin B} - x \cdot \frac{1}{\tan B}\]

    if -1.3668110012231458e+154 < F < 2.908999316112226e+32

    1. Initial program 1.8

      \[\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)}\]
    2. Simplified1.8

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-*l/0.4

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B}\]
    5. Using strategy rm
    6. Applied pow-neg0.4

      \[\leadsto \frac{F \cdot \color{blue}{\frac{1}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}}{\sin B} - x \cdot \frac{1}{\tan B}\]
    7. Applied un-div-inv0.4

      \[\leadsto \frac{\color{blue}{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}}{\sin B} - x \cdot \frac{1}{\tan B}\]
    8. Using strategy rm
    9. Applied associate-*r/0.3

      \[\leadsto \frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]

    if 2.908999316112226e+32 < F

    1. Initial program 26.3

      \[\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)}\]
    2. Simplified26.3

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-*l/20.2

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B}\]
    5. Taylor expanded around inf 0.2

      \[\leadsto \frac{\color{blue}{1 - 1 \cdot \frac{1}{{F}^{2}}}}{\sin B} - x \cdot \frac{1}{\tan B}\]
    6. Simplified0.2

      \[\leadsto \frac{\color{blue}{1 - \frac{\frac{1}{F}}{F}}}{\sin B} - x \cdot \frac{1}{\tan B}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.36681100122314579 \cdot 10^{154}:\\ \;\;\;\;\frac{\frac{\frac{1}{F}}{F} - 1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \le 2.90899931611222616 \cdot 10^{32}:\\ \;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{\frac{1}{F}}{F}}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2020105 
(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))))))