Average Error: 14.1 → 0.3
Time: 30.6s
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.291039132795298 \cdot 10^{+23}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 0.14762500256041372:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F\right) - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{1}{F \cdot F}}{\sin B} - \frac{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 \le -1.291039132795298 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r1364583 = x;
        double r1364584 = 1.0;
        double r1364585 = B;
        double r1364586 = tan(r1364585);
        double r1364587 = r1364584 / r1364586;
        double r1364588 = r1364583 * r1364587;
        double r1364589 = -r1364588;
        double r1364590 = F;
        double r1364591 = sin(r1364585);
        double r1364592 = r1364590 / r1364591;
        double r1364593 = r1364590 * r1364590;
        double r1364594 = 2.0;
        double r1364595 = r1364593 + r1364594;
        double r1364596 = r1364594 * r1364583;
        double r1364597 = r1364595 + r1364596;
        double r1364598 = r1364584 / r1364594;
        double r1364599 = -r1364598;
        double r1364600 = pow(r1364597, r1364599);
        double r1364601 = r1364592 * r1364600;
        double r1364602 = r1364589 + r1364601;
        return r1364602;
}

double f(double F, double B, double x) {
        double r1364603 = F;
        double r1364604 = -1.291039132795298e+23;
        bool r1364605 = r1364603 <= r1364604;
        double r1364606 = 1.0;
        double r1364607 = r1364603 * r1364603;
        double r1364608 = r1364606 / r1364607;
        double r1364609 = r1364608 - r1364606;
        double r1364610 = B;
        double r1364611 = sin(r1364610);
        double r1364612 = r1364609 / r1364611;
        double r1364613 = x;
        double r1364614 = tan(r1364610);
        double r1364615 = r1364613 / r1364614;
        double r1364616 = r1364612 - r1364615;
        double r1364617 = 0.14762500256041372;
        bool r1364618 = r1364603 <= r1364617;
        double r1364619 = r1364606 / r1364611;
        double r1364620 = 2.0;
        double r1364621 = r1364607 + r1364620;
        double r1364622 = r1364620 * r1364613;
        double r1364623 = r1364621 + r1364622;
        double r1364624 = -0.5;
        double r1364625 = pow(r1364623, r1364624);
        double r1364626 = r1364625 * r1364603;
        double r1364627 = r1364619 * r1364626;
        double r1364628 = r1364627 - r1364615;
        double r1364629 = r1364606 - r1364608;
        double r1364630 = r1364629 / r1364611;
        double r1364631 = r1364630 - r1364615;
        double r1364632 = r1364618 ? r1364628 : r1364631;
        double r1364633 = r1364605 ? r1364616 : r1364632;
        return r1364633;
}

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.291039132795298e+23

    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. Simplified20.7

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

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

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

    if -1.291039132795298e+23 < F < 0.14762500256041372

    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.3

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

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

    if 0.14762500256041372 < F

    1. Initial program 25.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. Simplified19.7

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

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

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

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

Reproduce

herbie shell --seed 2019168 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))