Average Error: 13.9 → 0.2
Time: 41.0s
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 -1.4806380137470963 \cdot 10^{+18}:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot \left(F \cdot F\right)} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 4.714618311488689 \cdot 10^{+47}:\\ \;\;\;\;\left(F \cdot \left({\left(\sqrt{2 + \left(F \cdot F + x \cdot 2\right)}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{2 + \left(F \cdot F + x \cdot 2\right)}\right)}^{\frac{-1}{2}}\right)\right) \cdot \frac{1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{x}{\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 -1.4806380137470963 \cdot 10^{+18}:\\
\;\;\;\;\left(\frac{1}{\sin B \cdot \left(F \cdot F\right)} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r751056 = x;
        double r751057 = 1.0;
        double r751058 = B;
        double r751059 = tan(r751058);
        double r751060 = r751057 / r751059;
        double r751061 = r751056 * r751060;
        double r751062 = -r751061;
        double r751063 = F;
        double r751064 = sin(r751058);
        double r751065 = r751063 / r751064;
        double r751066 = r751063 * r751063;
        double r751067 = 2.0;
        double r751068 = r751066 + r751067;
        double r751069 = r751067 * r751056;
        double r751070 = r751068 + r751069;
        double r751071 = r751057 / r751067;
        double r751072 = -r751071;
        double r751073 = pow(r751070, r751072);
        double r751074 = r751065 * r751073;
        double r751075 = r751062 + r751074;
        return r751075;
}

double f(double F, double B, double x) {
        double r751076 = F;
        double r751077 = -1.4806380137470963e+18;
        bool r751078 = r751076 <= r751077;
        double r751079 = 1.0;
        double r751080 = B;
        double r751081 = sin(r751080);
        double r751082 = r751076 * r751076;
        double r751083 = r751081 * r751082;
        double r751084 = r751079 / r751083;
        double r751085 = r751079 / r751081;
        double r751086 = r751084 - r751085;
        double r751087 = x;
        double r751088 = tan(r751080);
        double r751089 = r751087 / r751088;
        double r751090 = r751086 - r751089;
        double r751091 = 4.714618311488689e+47;
        bool r751092 = r751076 <= r751091;
        double r751093 = 2.0;
        double r751094 = r751087 * r751093;
        double r751095 = r751082 + r751094;
        double r751096 = r751093 + r751095;
        double r751097 = sqrt(r751096);
        double r751098 = -0.5;
        double r751099 = pow(r751097, r751098);
        double r751100 = r751099 * r751099;
        double r751101 = r751076 * r751100;
        double r751102 = r751101 * r751085;
        double r751103 = r751102 - r751089;
        double r751104 = r751085 - r751084;
        double r751105 = r751104 - r751089;
        double r751106 = r751092 ? r751103 : r751105;
        double r751107 = r751078 ? r751090 : r751106;
        return r751107;
}

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.4806380137470963e+18

    1. Initial program 26.1

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

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

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

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

    if -1.4806380137470963e+18 < F < 4.714618311488689e+47

    1. Initial program 0.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. Simplified0.3

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

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

      \[\leadsto \frac{{\color{blue}{\left(1 \cdot \left(\left(2 + F \cdot F\right) + x \cdot 2\right)\right)}}^{\frac{-1}{2}}}{\sin B \cdot \frac{1}{F}} - \frac{x}{\tan B}\]
    6. Applied unpow-prod-down0.3

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

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

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

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

      \[\leadsto \frac{1}{\sin B} \cdot \left({\color{blue}{\left(\sqrt{\left(x \cdot 2 + F \cdot F\right) + 2} \cdot \sqrt{\left(x \cdot 2 + F \cdot F\right) + 2}\right)}}^{\frac{-1}{2}} \cdot F\right) - \frac{x}{\tan B}\]
    12. Applied unpow-prod-down0.3

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

    if 4.714618311488689e+47 < F

    1. Initial program 28.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.4806380137470963 \cdot 10^{+18}:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot \left(F \cdot F\right)} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 4.714618311488689 \cdot 10^{+47}:\\ \;\;\;\;\left(F \cdot \left({\left(\sqrt{2 + \left(F \cdot F + x \cdot 2\right)}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{2 + \left(F \cdot F + x \cdot 2\right)}\right)}^{\frac{-1}{2}}\right)\right) \cdot \frac{1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{x}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2019152 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))