Average Error: 13.5 → 0.2
Time: 27.6s
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 -9.525405973574204716149159153810777477311 \cdot 10^{119}:\\ \;\;\;\;\frac{-1 + \frac{1}{F \cdot F}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 60420.70132716573425568640232086181640625:\\ \;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \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 -9.525405973574204716149159153810777477311 \cdot 10^{119}:\\
\;\;\;\;\frac{-1 + \frac{1}{F \cdot F}}{\sin B} - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r49812 = x;
        double r49813 = 1.0;
        double r49814 = B;
        double r49815 = tan(r49814);
        double r49816 = r49813 / r49815;
        double r49817 = r49812 * r49816;
        double r49818 = -r49817;
        double r49819 = F;
        double r49820 = sin(r49814);
        double r49821 = r49819 / r49820;
        double r49822 = r49819 * r49819;
        double r49823 = 2.0;
        double r49824 = r49822 + r49823;
        double r49825 = r49823 * r49812;
        double r49826 = r49824 + r49825;
        double r49827 = r49813 / r49823;
        double r49828 = -r49827;
        double r49829 = pow(r49826, r49828);
        double r49830 = r49821 * r49829;
        double r49831 = r49818 + r49830;
        return r49831;
}

double f(double F, double B, double x) {
        double r49832 = F;
        double r49833 = -9.525405973574205e+119;
        bool r49834 = r49832 <= r49833;
        double r49835 = -1.0;
        double r49836 = 1.0;
        double r49837 = r49832 * r49832;
        double r49838 = r49836 / r49837;
        double r49839 = r49835 + r49838;
        double r49840 = B;
        double r49841 = sin(r49840);
        double r49842 = r49839 / r49841;
        double r49843 = x;
        double r49844 = r49843 * r49836;
        double r49845 = tan(r49840);
        double r49846 = r49844 / r49845;
        double r49847 = r49842 - r49846;
        double r49848 = 60420.701327165734;
        bool r49849 = r49832 <= r49848;
        double r49850 = 2.0;
        double r49851 = r49837 + r49850;
        double r49852 = r49850 * r49843;
        double r49853 = r49851 + r49852;
        double r49854 = r49836 / r49850;
        double r49855 = -r49854;
        double r49856 = pow(r49853, r49855);
        double r49857 = r49832 * r49856;
        double r49858 = r49857 / r49841;
        double r49859 = cos(r49840);
        double r49860 = r49843 * r49859;
        double r49861 = r49860 / r49841;
        double r49862 = r49836 * r49861;
        double r49863 = r49858 - r49862;
        double r49864 = 1.0;
        double r49865 = r49864 / r49841;
        double r49866 = 2.0;
        double r49867 = pow(r49832, r49866);
        double r49868 = r49841 * r49867;
        double r49869 = r49836 / r49868;
        double r49870 = r49865 - r49869;
        double r49871 = r49870 - r49846;
        double r49872 = r49849 ? r49863 : r49871;
        double r49873 = r49834 ? r49847 : r49872;
        return r49873;
}

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 < -9.525405973574205e+119

    1. Initial program 36.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. Simplified36.6

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

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B}\]
    5. Using strategy rm
    6. Applied associate-*r/29.8

      \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    7. 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}\]
    8. Simplified0.2

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

    if -9.525405973574205e+119 < F < 60420.701327165734

    1. Initial program 1.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. Simplified1.2

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

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

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

    if 60420.701327165734 < F

    1. Initial program 24.3

      \[\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. Simplified24.3

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

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B}\]
    5. Using strategy rm
    6. Applied associate-*r/18.6

      \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    7. Using strategy rm
    8. Applied pow-neg18.6

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right)} - \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 -9.525405973574204716149159153810777477311 \cdot 10^{119}:\\ \;\;\;\;\frac{-1 + \frac{1}{F \cdot F}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 60420.70132716573425568640232086181640625:\\ \;\;\;\;\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\ \end{array}\]

Reproduce

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