Average Error: 14.1 → 0.6
Time: 22.4s
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 -1916035079740980815957939636404224:\\ \;\;\;\;\left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le \frac{3854101125246639}{2417851639229258349412352}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - 1 \cdot \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 -1916035079740980815957939636404224:\\
\;\;\;\;\left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

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

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - 1 \cdot \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 r45851 = x;
        double r45852 = 1.0;
        double r45853 = B;
        double r45854 = tan(r45853);
        double r45855 = r45852 / r45854;
        double r45856 = r45851 * r45855;
        double r45857 = -r45856;
        double r45858 = F;
        double r45859 = sin(r45853);
        double r45860 = r45858 / r45859;
        double r45861 = r45858 * r45858;
        double r45862 = 2.0;
        double r45863 = r45861 + r45862;
        double r45864 = r45862 * r45851;
        double r45865 = r45863 + r45864;
        double r45866 = r45852 / r45862;
        double r45867 = -r45866;
        double r45868 = pow(r45865, r45867);
        double r45869 = r45860 * r45868;
        double r45870 = r45857 + r45869;
        return r45870;
}

double f(double F, double B, double x) {
        double r45871 = F;
        double r45872 = -1.9160350797409808e+33;
        bool r45873 = r45871 <= r45872;
        double r45874 = 1.0;
        double r45875 = 1.0;
        double r45876 = B;
        double r45877 = sin(r45876);
        double r45878 = 2.0;
        double r45879 = pow(r45871, r45878);
        double r45880 = r45877 * r45879;
        double r45881 = r45875 / r45880;
        double r45882 = r45874 * r45881;
        double r45883 = r45875 / r45877;
        double r45884 = r45882 - r45883;
        double r45885 = x;
        double r45886 = r45885 * r45874;
        double r45887 = tan(r45876);
        double r45888 = r45886 / r45887;
        double r45889 = r45884 - r45888;
        double r45890 = 3854101125246639.0;
        double r45891 = 2.4178516392292583e+24;
        double r45892 = r45890 / r45891;
        bool r45893 = r45871 <= r45892;
        double r45894 = r45871 / r45877;
        double r45895 = r45871 * r45871;
        double r45896 = 2.0;
        double r45897 = r45895 + r45896;
        double r45898 = r45896 * r45885;
        double r45899 = r45897 + r45898;
        double r45900 = r45874 / r45896;
        double r45901 = pow(r45899, r45900);
        double r45902 = r45894 / r45901;
        double r45903 = r45902 - r45888;
        double r45904 = r45883 - r45882;
        double r45905 = r45904 - r45888;
        double r45906 = r45893 ? r45903 : r45905;
        double r45907 = r45873 ? r45889 : r45906;
        return r45907;
}

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.9160350797409808e+33

    1. Initial program 27.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. Simplified27.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 pow-neg27.3

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times21.5

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified21.5

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/21.4

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

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

    if -1.9160350797409808e+33 < F < 1.594018864811414e-09

    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{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 pow-neg0.5

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times0.4

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified0.4

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/0.3

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

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

    if 1.594018864811414e-09 < F

    1. Initial program 25.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. Simplified25.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 pow-neg25.3

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times19.1

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified19.1

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/19.1

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

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

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

Reproduce

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