Average Error: 13.2 → 0.2
Time: 40.2s
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 -141259778311901790863360:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)\\ \mathbf{elif}\;F \le 9401.995455885358751402236521244049072266:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}} + \left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\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 -141259778311901790863360:\\
\;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)\\

\mathbf{elif}\;F \le 9401.995455885358751402236521244049072266:\\
\;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}} + \left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\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 r75838 = x;
        double r75839 = 1.0;
        double r75840 = B;
        double r75841 = tan(r75840);
        double r75842 = r75839 / r75841;
        double r75843 = r75838 * r75842;
        double r75844 = -r75843;
        double r75845 = F;
        double r75846 = sin(r75840);
        double r75847 = r75845 / r75846;
        double r75848 = r75845 * r75845;
        double r75849 = 2.0;
        double r75850 = r75848 + r75849;
        double r75851 = r75849 * r75838;
        double r75852 = r75850 + r75851;
        double r75853 = r75839 / r75849;
        double r75854 = -r75853;
        double r75855 = pow(r75852, r75854);
        double r75856 = r75847 * r75855;
        double r75857 = r75844 + r75856;
        return r75857;
}

double f(double F, double B, double x) {
        double r75858 = F;
        double r75859 = -1.4125977831190179e+23;
        bool r75860 = r75858 <= r75859;
        double r75861 = 1.0;
        double r75862 = B;
        double r75863 = sin(r75862);
        double r75864 = 2.0;
        double r75865 = pow(r75858, r75864);
        double r75866 = r75863 * r75865;
        double r75867 = r75861 / r75866;
        double r75868 = -1.0;
        double r75869 = r75868 / r75863;
        double r75870 = r75867 + r75869;
        double r75871 = x;
        double r75872 = r75871 * r75861;
        double r75873 = tan(r75862);
        double r75874 = r75872 / r75873;
        double r75875 = -r75874;
        double r75876 = r75870 + r75875;
        double r75877 = 9401.995455885359;
        bool r75878 = r75858 <= r75877;
        double r75879 = 2.0;
        double r75880 = fma(r75858, r75858, r75879);
        double r75881 = fma(r75879, r75871, r75880);
        double r75882 = r75861 / r75879;
        double r75883 = -r75882;
        double r75884 = pow(r75881, r75883);
        double r75885 = r75863 / r75884;
        double r75886 = r75858 / r75885;
        double r75887 = r75872 / r75863;
        double r75888 = cos(r75862);
        double r75889 = r75887 * r75888;
        double r75890 = -r75889;
        double r75891 = r75886 + r75890;
        double r75892 = 1.0;
        double r75893 = r75892 / r75863;
        double r75894 = r75893 - r75867;
        double r75895 = r75875 + r75894;
        double r75896 = r75878 ? r75891 : r75895;
        double r75897 = r75860 ? r75876 : r75896;
        return r75897;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -1.4125977831190179e+23

    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. Using strategy rm
    3. Applied *-un-lft-identity25.6

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{1 \cdot \sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    4. Applied *-un-lft-identity25.6

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{1} \cdot \frac{F}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    6. Applied associate-*l*25.6

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{1} \cdot \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}}}\]
    8. Using strategy rm
    9. Applied associate-*r/20.4

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

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

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

    if -1.4125977831190179e+23 < F < 9401.995455885359

    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 *-un-lft-identity0.4

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{1 \cdot \sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    4. Applied *-un-lft-identity0.4

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{1} \cdot \frac{F}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    6. Applied associate-*l*0.4

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{1} \cdot \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}}}\]
    8. Using strategy rm
    9. Applied associate-*r/0.3

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{1} \cdot \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}}\]
    10. Using strategy rm
    11. Applied tan-quot0.3

      \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{1}{1} \cdot \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}}\]
    12. Applied associate-/r/0.3

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

    if 9401.995455885359 < F

    1. Initial program 24.2

      \[\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 *-un-lft-identity24.2

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{1 \cdot \sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    4. Applied *-un-lft-identity24.2

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{1} \cdot \frac{F}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    6. Applied associate-*l*24.2

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{1} \cdot \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}}}\]
    8. Using strategy rm
    9. Applied associate-*r/18.8

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{1} \cdot \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 -141259778311901790863360:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)\\ \mathbf{elif}\;F \le 9401.995455885358751402236521244049072266:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}} + \left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\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 2019303 +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))))))