Average Error: 13.9 → 0.2
Time: 19.2s
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 -5.192214669414230747509575416403219273655 \cdot 10^{147}:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 678669.467681691166944801807403564453125:\\ \;\;\;\;F \cdot \frac{1}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 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 -5.192214669414230747509575416403219273655 \cdot 10^{147}:\\
\;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r45540 = x;
        double r45541 = 1.0;
        double r45542 = B;
        double r45543 = tan(r45542);
        double r45544 = r45541 / r45543;
        double r45545 = r45540 * r45544;
        double r45546 = -r45545;
        double r45547 = F;
        double r45548 = sin(r45542);
        double r45549 = r45547 / r45548;
        double r45550 = r45547 * r45547;
        double r45551 = 2.0;
        double r45552 = r45550 + r45551;
        double r45553 = r45551 * r45540;
        double r45554 = r45552 + r45553;
        double r45555 = r45541 / r45551;
        double r45556 = -r45555;
        double r45557 = pow(r45554, r45556);
        double r45558 = r45549 * r45557;
        double r45559 = r45546 + r45558;
        return r45559;
}

double f(double F, double B, double x) {
        double r45560 = F;
        double r45561 = -5.192214669414231e+147;
        bool r45562 = r45560 <= r45561;
        double r45563 = 1.0;
        double r45564 = B;
        double r45565 = sin(r45564);
        double r45566 = 2.0;
        double r45567 = pow(r45560, r45566);
        double r45568 = r45565 * r45567;
        double r45569 = r45563 / r45568;
        double r45570 = 1.0;
        double r45571 = r45570 / r45565;
        double r45572 = r45569 - r45571;
        double r45573 = x;
        double r45574 = r45573 * r45563;
        double r45575 = tan(r45564);
        double r45576 = r45574 / r45575;
        double r45577 = r45572 - r45576;
        double r45578 = 678669.4676816912;
        bool r45579 = r45560 <= r45578;
        double r45580 = r45560 * r45560;
        double r45581 = 2.0;
        double r45582 = r45580 + r45581;
        double r45583 = r45581 * r45573;
        double r45584 = r45582 + r45583;
        double r45585 = r45563 / r45581;
        double r45586 = pow(r45584, r45585);
        double r45587 = r45565 * r45586;
        double r45588 = r45570 / r45587;
        double r45589 = r45560 * r45588;
        double r45590 = r45589 - r45576;
        double r45591 = r45571 - r45569;
        double r45592 = r45591 - r45576;
        double r45593 = r45579 ? r45590 : r45592;
        double r45594 = r45562 ? r45577 : r45593;
        return r45594;
}

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 < -5.192214669414231e+147

    1. Initial program 41.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. Simplified41.7

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

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified36.5

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

      \[\leadsto \frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    9. 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}\]
    10. Simplified0.2

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

    if -5.192214669414231e+147 < F < 678669.4676816912

    1. Initial program 1.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. Simplified1.6

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

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified0.4

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

      \[\leadsto \frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    9. Using strategy rm
    10. Applied div-inv0.3

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

    if 678669.4676816912 < F

    1. Initial program 25.5

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

      \[\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 pow-neg25.5

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified20.2

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

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

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

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

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

Reproduce

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