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

\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 r41818 = x;
        double r41819 = 1.0;
        double r41820 = B;
        double r41821 = tan(r41820);
        double r41822 = r41819 / r41821;
        double r41823 = r41818 * r41822;
        double r41824 = -r41823;
        double r41825 = F;
        double r41826 = sin(r41820);
        double r41827 = r41825 / r41826;
        double r41828 = r41825 * r41825;
        double r41829 = 2.0;
        double r41830 = r41828 + r41829;
        double r41831 = r41829 * r41818;
        double r41832 = r41830 + r41831;
        double r41833 = r41819 / r41829;
        double r41834 = -r41833;
        double r41835 = pow(r41832, r41834);
        double r41836 = r41827 * r41835;
        double r41837 = r41824 + r41836;
        return r41837;
}

double f(double F, double B, double x) {
        double r41838 = F;
        double r41839 = -9.525405973574205e+119;
        bool r41840 = r41838 <= r41839;
        double r41841 = x;
        double r41842 = 1.0;
        double r41843 = r41841 * r41842;
        double r41844 = B;
        double r41845 = tan(r41844);
        double r41846 = r41843 / r41845;
        double r41847 = -r41846;
        double r41848 = 1.0;
        double r41849 = sin(r41844);
        double r41850 = 2.0;
        double r41851 = pow(r41838, r41850);
        double r41852 = r41849 * r41851;
        double r41853 = r41848 / r41852;
        double r41854 = r41842 * r41853;
        double r41855 = r41848 / r41849;
        double r41856 = r41854 - r41855;
        double r41857 = r41847 + r41856;
        double r41858 = 60420.701327165734;
        bool r41859 = r41838 <= r41858;
        double r41860 = cos(r41844);
        double r41861 = r41841 * r41860;
        double r41862 = r41861 / r41849;
        double r41863 = r41842 * r41862;
        double r41864 = -r41863;
        double r41865 = r41838 * r41838;
        double r41866 = 2.0;
        double r41867 = r41865 + r41866;
        double r41868 = r41866 * r41841;
        double r41869 = r41867 + r41868;
        double r41870 = r41842 / r41866;
        double r41871 = -r41870;
        double r41872 = pow(r41869, r41871);
        double r41873 = r41838 * r41872;
        double r41874 = r41873 / r41849;
        double r41875 = r41864 + r41874;
        double r41876 = r41855 - r41854;
        double r41877 = r41847 + r41876;
        double r41878 = r41859 ? r41875 : r41877;
        double r41879 = r41840 ? r41857 : r41878;
        return r41879;
}

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. Using strategy rm
    3. Applied associate-*l/29.9

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\]
    6. 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 -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. Using strategy rm
    3. Applied associate-*l/0.4

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

      \[\leadsto \left(-\color{blue}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\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. Using strategy rm
    3. Applied associate-*l/18.7

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \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}\]
    8. Applied un-div-inv18.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -9.525405973574204716149159153810777477311 \cdot 10^{119}:\\ \;\;\;\;\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 60420.70132716573425568640232086181640625:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\\ \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 2019347 +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))))))