Average Error: 14.0 → 0.2
Time: 37.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 -6436982318645.525390625:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right)\\ \mathbf{elif}\;F \le 13740.11341628399168257601559162139892578:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\frac{F}{\sin B}}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \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 -6436982318645.525390625:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right)\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r46885 = x;
        double r46886 = 1.0;
        double r46887 = B;
        double r46888 = tan(r46887);
        double r46889 = r46886 / r46888;
        double r46890 = r46885 * r46889;
        double r46891 = -r46890;
        double r46892 = F;
        double r46893 = sin(r46887);
        double r46894 = r46892 / r46893;
        double r46895 = r46892 * r46892;
        double r46896 = 2.0;
        double r46897 = r46895 + r46896;
        double r46898 = r46896 * r46885;
        double r46899 = r46897 + r46898;
        double r46900 = r46886 / r46896;
        double r46901 = -r46900;
        double r46902 = pow(r46899, r46901);
        double r46903 = r46894 * r46902;
        double r46904 = r46891 + r46903;
        return r46904;
}

double f(double F, double B, double x) {
        double r46905 = F;
        double r46906 = -6436982318645.525;
        bool r46907 = r46905 <= r46906;
        double r46908 = x;
        double r46909 = 1.0;
        double r46910 = r46908 * r46909;
        double r46911 = B;
        double r46912 = tan(r46911);
        double r46913 = r46910 / r46912;
        double r46914 = -r46913;
        double r46915 = sin(r46911);
        double r46916 = 2.0;
        double r46917 = pow(r46905, r46916);
        double r46918 = r46915 * r46917;
        double r46919 = r46909 / r46918;
        double r46920 = -1.0;
        double r46921 = r46920 / r46915;
        double r46922 = r46919 + r46921;
        double r46923 = r46914 + r46922;
        double r46924 = 13740.113416283992;
        bool r46925 = r46905 <= r46924;
        double r46926 = r46905 / r46915;
        double r46927 = r46905 * r46905;
        double r46928 = 2.0;
        double r46929 = r46927 + r46928;
        double r46930 = r46928 * r46908;
        double r46931 = r46929 + r46930;
        double r46932 = r46909 / r46928;
        double r46933 = pow(r46931, r46932);
        double r46934 = r46926 / r46933;
        double r46935 = r46914 + r46934;
        double r46936 = 1.0;
        double r46937 = r46936 / r46915;
        double r46938 = r46937 - r46919;
        double r46939 = r46914 + r46938;
        double r46940 = r46925 ? r46935 : r46939;
        double r46941 = r46907 ? r46923 : r46940;
        return r46941;
}

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

    1. Initial program 26.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. Using strategy rm
    3. Applied associate-*r/26.4

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}\]
    4. Taylor expanded around -inf 0.1

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

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

    if -6436982318645.525 < F < 13740.113416283992

    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. Using strategy rm
    3. Applied associate-*r/0.3

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}\]
    4. Using strategy rm
    5. Applied pow-neg0.3

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \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)}}}\]
    6. Applied un-div-inv0.3

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

    if 13740.113416283992 < F

    1. Initial program 25.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. Using strategy rm
    3. Applied associate-*r/24.9

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}\]
    4. Taylor expanded around inf 0.2

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

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

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

Reproduce

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