Average Error: 13.9 → 0.3
Time: 9.7s
Precision: binary64
\[\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 -1.1305106783563191 \cdot 10^{+26}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(-1 + \frac{1}{F \cdot F}\right) - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \leq 6874909.974872331:\\ \;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{1 \cdot x}{\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 \leq -1.1305106783563191 \cdot 10^{+26}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left(-1 + \frac{1}{F \cdot F}\right) - \frac{1 \cdot x}{\tan B}\\

\mathbf{elif}\;F \leq 6874909.974872331:\\
\;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{1 \cdot 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 -1.1305106783563191e+26)
   (- (* (/ 1.0 (sin B)) (+ -1.0 (/ 1.0 (* F F)))) (/ (* 1.0 x) (tan B)))
   (if (<= F 6874909.974872331)
     (-
      (/ (* F (pow (+ (+ (* F F) 2.0) (* x 2.0)) (- (/ 1.0 2.0)))) (sin B))
      (/ 1.0 (/ (tan B) (* 1.0 x))))
     (-
      (- (/ 1.0 (sin B)) (/ 1.0 (* (sin B) (* F F))))
      (/ (* 1.0 x) (tan B))))))
double code(double F, double B, double x) {
	return ((double) (((double) -(((double) (x * (1.0 / ((double) tan(B))))))) + ((double) ((F / ((double) sin(B))) * ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (2.0 * x)))), ((double) -((1.0 / 2.0)))))))));
}
double code(double F, double B, double x) {
	double tmp;
	if ((F <= -1.1305106783563191e+26)) {
		tmp = ((double) (((double) ((1.0 / ((double) sin(B))) * ((double) (-1.0 + (1.0 / ((double) (F * F))))))) - (((double) (1.0 * x)) / ((double) tan(B)))));
	} else {
		double tmp_1;
		if ((F <= 6874909.974872331)) {
			tmp_1 = ((double) ((((double) (F * ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (x * 2.0)))), ((double) -((1.0 / 2.0))))))) / ((double) sin(B))) - (1.0 / (((double) tan(B)) / ((double) (1.0 * x))))));
		} else {
			tmp_1 = ((double) (((double) ((1.0 / ((double) sin(B))) - (1.0 / ((double) (((double) sin(B)) * ((double) (F * F))))))) - (((double) (1.0 * x)) / ((double) tan(B)))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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.1305106783563191e26

    1. Initial program 25.2

      \[\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. Simplified25.2

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

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

      \[\leadsto \frac{\color{blue}{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}\]
    6. Using strategy rm
    7. Applied associate-*r/_binary6419.3

      \[\leadsto \frac{F \cdot {\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}}\]
    8. Taylor expanded around -inf 0.2

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

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

    if -1.1305106783563191e26 < F < 6874909.97487233113

    1. Initial program 0.4

      \[\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. Simplified0.4

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

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

      \[\leadsto \frac{\color{blue}{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}\]
    6. Using strategy rm
    7. Applied associate-*r/_binary640.3

      \[\leadsto \frac{F \cdot {\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}}\]
    8. Using strategy rm
    9. Applied clear-num_binary640.4

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

    if 6874909.97487233113 < F

    1. Initial program 26.6

      \[\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.6

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

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

      \[\leadsto \frac{\color{blue}{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}\]
    6. Using strategy rm
    7. Applied associate-*r/_binary6420.2

      \[\leadsto \frac{F \cdot {\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}}\]
    8. Taylor expanded around inf 0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.1305106783563191 \cdot 10^{+26}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(-1 + \frac{1}{F \cdot F}\right) - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \leq 6874909.974872331:\\ \;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{1 \cdot x}{\tan B}\\ \end{array}\]

Reproduce

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