Average Error: 14.3 → 0.2
Time: 12.4s
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 -9.69079147007961829 \cdot 10^{125}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\frac{\frac{1}{F}}{F} - 1}{\sin B}\\ \mathbf{elif}\;F \le 2.6571035656186667 \cdot 10^{53}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot 1}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1 - \frac{\frac{1}{F}}{F}}{\sin 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 -9.69079147007961829 \cdot 10^{125}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\frac{\frac{1}{F}}{F} - 1}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1 - \frac{\frac{1}{F}}{F}}{\sin 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 temp;
	if ((F <= -9.690791470079618e+125)) {
		temp = (-((x * 1.0) / tan(B)) + ((((1.0 / F) / F) - 1.0) / sin(B)));
	} else {
		double temp_1;
		if ((F <= 2.6571035656186667e+53)) {
			temp_1 = (-((x * 1.0) / tan(B)) + ((F * 1.0) / (sin(B) * pow((((F * F) + 2.0) + (2.0 * x)), (1.0 / 2.0)))));
		} else {
			temp_1 = (-((x * 1.0) / tan(B)) + ((1.0 - ((1.0 / F) / F)) / sin(B)));
		}
		temp = temp_1;
	}
	return temp;
}

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 < -9.690791470079618e+125

    1. Initial program 38.0

      \[\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. Using strategy rm
    3. Applied associate-*l/31.9

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

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

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

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

    if -9.690791470079618e+125 < F < 2.6571035656186667e+53

    1. Initial program 1.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. Using strategy rm
    3. Applied associate-*l/0.4

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \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}\]
    8. Applied associate-*r/0.2

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

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

    if 2.6571035656186667e+53 < F

    1. Initial program 29.7

      \[\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. Using strategy rm
    3. Applied associate-*l/23.5

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

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

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

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

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

Reproduce

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