Average Error: 14.0 → 0.2
Time: 29.8s
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 r1391577 = x;
        double r1391578 = 1.0;
        double r1391579 = B;
        double r1391580 = tan(r1391579);
        double r1391581 = r1391578 / r1391580;
        double r1391582 = r1391577 * r1391581;
        double r1391583 = -r1391582;
        double r1391584 = F;
        double r1391585 = sin(r1391579);
        double r1391586 = r1391584 / r1391585;
        double r1391587 = r1391584 * r1391584;
        double r1391588 = 2.0;
        double r1391589 = r1391587 + r1391588;
        double r1391590 = r1391588 * r1391577;
        double r1391591 = r1391589 + r1391590;
        double r1391592 = r1391578 / r1391588;
        double r1391593 = -r1391592;
        double r1391594 = pow(r1391591, r1391593);
        double r1391595 = r1391586 * r1391594;
        double r1391596 = r1391583 + r1391595;
        return r1391596;
}

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

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))))))