Average Error: 14.0 → 0.2
Time: 35.0s
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.5555718098587194 \cdot 10^{+32}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 11392.48259111127:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \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.5555718098587194 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \le 11392.48259111127:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \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 r1391574 = x;
        double r1391575 = 1.0;
        double r1391576 = B;
        double r1391577 = tan(r1391576);
        double r1391578 = r1391575 / r1391577;
        double r1391579 = r1391574 * r1391578;
        double r1391580 = -r1391579;
        double r1391581 = F;
        double r1391582 = sin(r1391576);
        double r1391583 = r1391581 / r1391582;
        double r1391584 = r1391581 * r1391581;
        double r1391585 = 2.0;
        double r1391586 = r1391584 + r1391585;
        double r1391587 = r1391585 * r1391574;
        double r1391588 = r1391586 + r1391587;
        double r1391589 = r1391575 / r1391585;
        double r1391590 = -r1391589;
        double r1391591 = pow(r1391588, r1391590);
        double r1391592 = r1391583 * r1391591;
        double r1391593 = r1391580 + r1391592;
        return r1391593;
}

double f(double F, double B, double x) {
        double r1391594 = F;
        double r1391595 = -1.5555718098587194e+32;
        bool r1391596 = r1391594 <= r1391595;
        double r1391597 = 1.0;
        double r1391598 = r1391594 * r1391594;
        double r1391599 = r1391597 / r1391598;
        double r1391600 = r1391599 - r1391597;
        double r1391601 = B;
        double r1391602 = sin(r1391601);
        double r1391603 = r1391600 / r1391602;
        double r1391604 = x;
        double r1391605 = tan(r1391601);
        double r1391606 = r1391604 / r1391605;
        double r1391607 = r1391603 - r1391606;
        double r1391608 = 11392.48259111127;
        bool r1391609 = r1391594 <= r1391608;
        double r1391610 = 2.0;
        double r1391611 = r1391598 + r1391610;
        double r1391612 = r1391610 * r1391604;
        double r1391613 = r1391611 + r1391612;
        double r1391614 = -0.5;
        double r1391615 = pow(r1391613, r1391614);
        double r1391616 = r1391594 / r1391602;
        double r1391617 = r1391615 * r1391616;
        double r1391618 = r1391617 - r1391606;
        double r1391619 = r1391597 - r1391599;
        double r1391620 = r1391619 / r1391602;
        double r1391621 = r1391620 - r1391606;
        double r1391622 = r1391609 ? r1391618 : r1391621;
        double r1391623 = r1391596 ? r1391607 : r1391622;
        return r1391623;
}

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.5555718098587194e+32

    1. Initial program 27.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. Simplified21.5

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

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

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

    if -1.5555718098587194e+32 < F < 11392.48259111127

    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}\]
    5. Using strategy rm
    6. Applied associate-*l*0.4

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

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

    if 11392.48259111127 < 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. Simplified20.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.5555718098587194 \cdot 10^{+32}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 11392.48259111127:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \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 2019163 
(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))))))