Average Error: 13.3 → 0.2
Time: 2.8m
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 -2308058990.5268726:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 497691.5673592028:\\ \;\;\;\;\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \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 -2308058990.5268726:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \le 497691.5673592028:\\
\;\;\;\;\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \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 r12517791 = x;
        double r12517792 = 1.0;
        double r12517793 = B;
        double r12517794 = tan(r12517793);
        double r12517795 = r12517792 / r12517794;
        double r12517796 = r12517791 * r12517795;
        double r12517797 = -r12517796;
        double r12517798 = F;
        double r12517799 = sin(r12517793);
        double r12517800 = r12517798 / r12517799;
        double r12517801 = r12517798 * r12517798;
        double r12517802 = 2.0;
        double r12517803 = r12517801 + r12517802;
        double r12517804 = r12517802 * r12517791;
        double r12517805 = r12517803 + r12517804;
        double r12517806 = r12517792 / r12517802;
        double r12517807 = -r12517806;
        double r12517808 = pow(r12517805, r12517807);
        double r12517809 = r12517800 * r12517808;
        double r12517810 = r12517797 + r12517809;
        return r12517810;
}

double f(double F, double B, double x) {
        double r12517811 = F;
        double r12517812 = -2308058990.5268726;
        bool r12517813 = r12517811 <= r12517812;
        double r12517814 = 1.0;
        double r12517815 = r12517811 * r12517811;
        double r12517816 = r12517814 / r12517815;
        double r12517817 = r12517816 - r12517814;
        double r12517818 = B;
        double r12517819 = sin(r12517818);
        double r12517820 = r12517817 / r12517819;
        double r12517821 = x;
        double r12517822 = tan(r12517818);
        double r12517823 = r12517821 / r12517822;
        double r12517824 = r12517820 - r12517823;
        double r12517825 = 497691.5673592028;
        bool r12517826 = r12517811 <= r12517825;
        double r12517827 = 2.0;
        double r12517828 = r12517815 + r12517827;
        double r12517829 = r12517827 * r12517821;
        double r12517830 = r12517828 + r12517829;
        double r12517831 = -0.5;
        double r12517832 = pow(r12517830, r12517831);
        double r12517833 = r12517819 / r12517811;
        double r12517834 = r12517832 / r12517833;
        double r12517835 = r12517834 - r12517823;
        double r12517836 = r12517814 - r12517816;
        double r12517837 = r12517836 / r12517819;
        double r12517838 = r12517837 - r12517823;
        double r12517839 = r12517826 ? r12517835 : r12517838;
        double r12517840 = r12517813 ? r12517824 : r12517839;
        return r12517840;
}

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

    1. Initial program 24.1

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

      \[\leadsto \color{blue}{\frac{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\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 -2308058990.5268726 < F < 497691.5673592028

    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) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-/l*0.3

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

    if 497691.5673592028 < F

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

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

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

      \[\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 -2308058990.5268726:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 497691.5673592028:\\ \;\;\;\;\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \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 2019125 
(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))))))