Average Error: 13.6 → 0.2
Time: 52.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 -29785009876925.47265625:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} + -1}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 40253580.936572492122650146484375:\\ \;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{1}{F \cdot F}}{\sin B} - \frac{x \cdot 1}{\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 -29785009876925.47265625:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} + -1}{\sin B} - \frac{x \cdot 1}{\tan B}\\

\mathbf{elif}\;F \le 40253580.936572492122650146484375:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{x \cdot 1}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \frac{1}{F \cdot F}}{\sin B} - \frac{x \cdot 1}{\tan B}\\

\end{array}
double f(double F, double B, double x) {
        double r3708876 = x;
        double r3708877 = 1.0;
        double r3708878 = B;
        double r3708879 = tan(r3708878);
        double r3708880 = r3708877 / r3708879;
        double r3708881 = r3708876 * r3708880;
        double r3708882 = -r3708881;
        double r3708883 = F;
        double r3708884 = sin(r3708878);
        double r3708885 = r3708883 / r3708884;
        double r3708886 = r3708883 * r3708883;
        double r3708887 = 2.0;
        double r3708888 = r3708886 + r3708887;
        double r3708889 = r3708887 * r3708876;
        double r3708890 = r3708888 + r3708889;
        double r3708891 = r3708877 / r3708887;
        double r3708892 = -r3708891;
        double r3708893 = pow(r3708890, r3708892);
        double r3708894 = r3708885 * r3708893;
        double r3708895 = r3708882 + r3708894;
        return r3708895;
}

double f(double F, double B, double x) {
        double r3708896 = F;
        double r3708897 = -29785009876925.473;
        bool r3708898 = r3708896 <= r3708897;
        double r3708899 = 1.0;
        double r3708900 = r3708896 * r3708896;
        double r3708901 = r3708899 / r3708900;
        double r3708902 = -1.0;
        double r3708903 = r3708901 + r3708902;
        double r3708904 = B;
        double r3708905 = sin(r3708904);
        double r3708906 = r3708903 / r3708905;
        double r3708907 = x;
        double r3708908 = r3708907 * r3708899;
        double r3708909 = tan(r3708904);
        double r3708910 = r3708908 / r3708909;
        double r3708911 = r3708906 - r3708910;
        double r3708912 = 40253580.93657249;
        bool r3708913 = r3708896 <= r3708912;
        double r3708914 = 2.0;
        double r3708915 = fma(r3708896, r3708896, r3708914);
        double r3708916 = fma(r3708914, r3708907, r3708915);
        double r3708917 = r3708899 / r3708914;
        double r3708918 = -r3708917;
        double r3708919 = pow(r3708916, r3708918);
        double r3708920 = r3708896 / r3708905;
        double r3708921 = r3708919 * r3708920;
        double r3708922 = r3708921 - r3708910;
        double r3708923 = 1.0;
        double r3708924 = r3708923 - r3708901;
        double r3708925 = r3708924 / r3708905;
        double r3708926 = r3708925 - r3708910;
        double r3708927 = r3708913 ? r3708922 : r3708926;
        double r3708928 = r3708898 ? r3708911 : r3708927;
        return r3708928;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -29785009876925.473

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

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

      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    5. Using strategy rm
    6. Applied pow-neg20.0

      \[\leadsto \frac{\color{blue}{\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}} \cdot F}{\sin B} - \frac{x \cdot 1}{\tan B}\]
    7. Applied associate-*l/20.0

      \[\leadsto \frac{\color{blue}{\frac{1 \cdot F}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}}}{\sin B} - \frac{x \cdot 1}{\tan B}\]
    8. Simplified20.0

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{F \cdot F} + -1}}{\sin B} - \frac{x \cdot 1}{\tan B}\]

    if -29785009876925.473 < F < 40253580.93657249

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

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

      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity0.3

      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\color{blue}{1 \cdot \sin B}} - \frac{x \cdot 1}{\tan B}\]
    7. Applied times-frac0.3

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}}{1} \cdot \frac{F}{\sin B}} - \frac{x \cdot 1}{\tan B}\]
    8. Simplified0.3

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

    if 40253580.93657249 < F

    1. Initial program 24.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. Simplified18.4

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

      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    5. Using strategy rm
    6. Applied pow-neg18.4

      \[\leadsto \frac{\color{blue}{\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}} \cdot F}{\sin B} - \frac{x \cdot 1}{\tan B}\]
    7. Applied associate-*l/18.3

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

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

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))