Average Error: 13.8 → 0.3
Time: 10.1s
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 -311106551405.7238:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(\frac{1}{F \cdot F} + -1\right) - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \leq 390.90111054659343:\\ \;\;\;\;\frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(\frac{1}{2}\right)}} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + 1 \cdot {\left(\frac{1}{{F}^{1}}\right)}^{1}\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 -311106551405.7238:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left(\frac{1}{F \cdot F} + -1\right) - \frac{1 \cdot x}{\tan B}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + 1 \cdot {\left(\frac{1}{{F}^{1}}\right)}^{1}\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 -311106551405.7238)
   (- (* (/ 1.0 (sin B)) (+ (/ 1.0 (* F F)) -1.0)) (/ (* 1.0 x) (tan B)))
   (if (<= F 390.90111054659343)
     (-
      (/ F (* (sin B) (pow (+ (+ (* F F) 2.0) (* x 2.0)) (/ 1.0 2.0))))
      (* 1.0 (/ (* x (cos B)) (sin B))))
     (-
      (/ F (* (sin B) (+ F (* 1.0 (pow (/ 1.0 (pow F 1.0)) 1.0)))))
      (/ (* 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 <= -311106551405.7238)) {
		tmp = ((double) (((double) ((1.0 / ((double) sin(B))) * ((double) ((1.0 / ((double) (F * F))) + -1.0)))) - (((double) (1.0 * x)) / ((double) tan(B)))));
	} else {
		double tmp_1;
		if ((F <= 390.90111054659343)) {
			tmp_1 = ((double) ((F / ((double) (((double) sin(B)) * ((double) pow(((double) (((double) (((double) (F * F)) + 2.0)) + ((double) (x * 2.0)))), (1.0 / 2.0)))))) - ((double) (1.0 * (((double) (x * ((double) cos(B)))) / ((double) sin(B)))))));
		} else {
			tmp_1 = ((double) ((F / ((double) (((double) sin(B)) * ((double) (F + ((double) (1.0 * ((double) pow((1.0 / ((double) pow(F, 1.0))), 1.0))))))))) - (((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 < -311106551405.723816

    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 pow-neg_binary6426.6

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified20.1

      \[\leadsto \frac{\color{blue}{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}\]
    7. Simplified20.1

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

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

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

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

    if -311106551405.723816 < F < 390.901110546593429

    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 pow-neg_binary640.4

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified0.4

      \[\leadsto \frac{\color{blue}{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}\]
    7. Simplified0.4

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

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

    if 390.901110546593429 < F

    1. Initial program 23.9

      \[\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. Simplified23.9

      \[\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 pow-neg_binary6423.8

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified18.3

      \[\leadsto \frac{\color{blue}{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}\]
    7. Simplified18.3

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

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

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

      \[\leadsto \frac{F}{\color{blue}{\sin B \cdot \left(1 \cdot {\left(\frac{1}{{F}^{1}}\right)}^{1} + F\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 -311106551405.7238:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(\frac{1}{F \cdot F} + -1\right) - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \leq 390.90111054659343:\\ \;\;\;\;\frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(\frac{1}{2}\right)}} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + 1 \cdot {\left(\frac{1}{{F}^{1}}\right)}^{1}\right)} - \frac{1 \cdot x}{\tan B}\\ \end{array}\]

Reproduce

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