Average Error: 13.7 → 0.3
Time: 37.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 -34867.44529332751:\\ \;\;\;\;\left(\frac{\frac{1}{F \cdot F}}{\sin B} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 1.5899146587837336:\\ \;\;\;\;\left({\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{\frac{-1}{4}} \cdot {\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{\frac{-1}{4}}\right) \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{1}{F \cdot F}}{\sin B} - \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 -34867.44529332751:\\
\;\;\;\;\left(\frac{\frac{1}{F \cdot F}}{\sin B} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r1153816 = x;
        double r1153817 = 1.0;
        double r1153818 = B;
        double r1153819 = tan(r1153818);
        double r1153820 = r1153817 / r1153819;
        double r1153821 = r1153816 * r1153820;
        double r1153822 = -r1153821;
        double r1153823 = F;
        double r1153824 = sin(r1153818);
        double r1153825 = r1153823 / r1153824;
        double r1153826 = r1153823 * r1153823;
        double r1153827 = 2.0;
        double r1153828 = r1153826 + r1153827;
        double r1153829 = r1153827 * r1153816;
        double r1153830 = r1153828 + r1153829;
        double r1153831 = r1153817 / r1153827;
        double r1153832 = -r1153831;
        double r1153833 = pow(r1153830, r1153832);
        double r1153834 = r1153825 * r1153833;
        double r1153835 = r1153822 + r1153834;
        return r1153835;
}

double f(double F, double B, double x) {
        double r1153836 = F;
        double r1153837 = -34867.44529332751;
        bool r1153838 = r1153836 <= r1153837;
        double r1153839 = 1.0;
        double r1153840 = r1153836 * r1153836;
        double r1153841 = r1153839 / r1153840;
        double r1153842 = B;
        double r1153843 = sin(r1153842);
        double r1153844 = r1153841 / r1153843;
        double r1153845 = r1153839 / r1153843;
        double r1153846 = r1153844 - r1153845;
        double r1153847 = x;
        double r1153848 = tan(r1153842);
        double r1153849 = r1153847 / r1153848;
        double r1153850 = r1153846 - r1153849;
        double r1153851 = 1.5899146587837336;
        bool r1153852 = r1153836 <= r1153851;
        double r1153853 = 2.0;
        double r1153854 = r1153847 * r1153853;
        double r1153855 = r1153853 + r1153840;
        double r1153856 = r1153854 + r1153855;
        double r1153857 = -0.25;
        double r1153858 = pow(r1153856, r1153857);
        double r1153859 = r1153858 * r1153858;
        double r1153860 = r1153836 / r1153843;
        double r1153861 = r1153859 * r1153860;
        double r1153862 = r1153861 - r1153849;
        double r1153863 = r1153839 - r1153841;
        double r1153864 = r1153863 / r1153843;
        double r1153865 = r1153864 - r1153849;
        double r1153866 = r1153852 ? r1153862 : r1153865;
        double r1153867 = r1153838 ? r1153850 : r1153866;
        return r1153867;
}

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 < -34867.44529332751

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

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

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

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

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

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

    if -34867.44529332751 < F < 1.5899146587837336

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

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

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

    if 1.5899146587837336 < F

    1. Initial program 24.7

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

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

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

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

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

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

Reproduce

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