Average Error: 13.8 → 0.7
Time: 12.9s
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.27155791236283758 \cdot 10^{49}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 6.6108987237771317 \cdot 10^{-11}:\\ \;\;\;\;\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} - 1 \cdot \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 -1.27155791236283758 \cdot 10^{49}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\

\mathbf{elif}\;F \le 6.6108987237771317 \cdot 10^{-11}:\\
\;\;\;\;\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} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\

\end{array}
double f(double F, double B, double x) {
        double r42847 = x;
        double r42848 = 1.0;
        double r42849 = B;
        double r42850 = tan(r42849);
        double r42851 = r42848 / r42850;
        double r42852 = r42847 * r42851;
        double r42853 = -r42852;
        double r42854 = F;
        double r42855 = sin(r42849);
        double r42856 = r42854 / r42855;
        double r42857 = r42854 * r42854;
        double r42858 = 2.0;
        double r42859 = r42857 + r42858;
        double r42860 = r42858 * r42847;
        double r42861 = r42859 + r42860;
        double r42862 = r42848 / r42858;
        double r42863 = -r42862;
        double r42864 = pow(r42861, r42863);
        double r42865 = r42856 * r42864;
        double r42866 = r42853 + r42865;
        return r42866;
}

double f(double F, double B, double x) {
        double r42867 = F;
        double r42868 = -1.2715579123628376e+49;
        bool r42869 = r42867 <= r42868;
        double r42870 = x;
        double r42871 = 1.0;
        double r42872 = r42870 * r42871;
        double r42873 = B;
        double r42874 = tan(r42873);
        double r42875 = r42872 / r42874;
        double r42876 = -r42875;
        double r42877 = 1.0;
        double r42878 = sin(r42873);
        double r42879 = 2.0;
        double r42880 = pow(r42867, r42879);
        double r42881 = r42878 * r42880;
        double r42882 = r42877 / r42881;
        double r42883 = r42871 * r42882;
        double r42884 = r42877 / r42878;
        double r42885 = r42883 - r42884;
        double r42886 = r42876 + r42885;
        double r42887 = 6.610898723777132e-11;
        bool r42888 = r42867 <= r42887;
        double r42889 = r42867 / r42878;
        double r42890 = r42867 * r42867;
        double r42891 = 2.0;
        double r42892 = r42890 + r42891;
        double r42893 = r42891 * r42870;
        double r42894 = r42892 + r42893;
        double r42895 = r42871 / r42891;
        double r42896 = pow(r42894, r42895);
        double r42897 = r42889 / r42896;
        double r42898 = r42876 + r42897;
        double r42899 = r42884 - r42883;
        double r42900 = r42876 + r42899;
        double r42901 = r42888 ? r42898 : r42900;
        double r42902 = r42869 ? r42886 : r42901;
        return r42902;
}

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.2715579123628376e+49

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

      \[\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(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)}\]

    if -1.2715579123628376e+49 < F < 6.610898723777132e-11

    1. Initial program 0.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/0.5

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

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

      \[\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 6.610898723777132e-11 < F

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

      \[\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 1.7

      \[\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)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.27155791236283758 \cdot 10^{49}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 6.6108987237771317 \cdot 10^{-11}:\\ \;\;\;\;\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} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020018 +o rules:numerics
(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))))))