Average Error: 14.2 → 0.3
Time: 12.5s
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.91574468424460201 \cdot 10^{23}:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 1.2208528278557798 \cdot 10^{27}:\\ \;\;\;\;\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{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 -1.91574468424460201 \cdot 10^{23}:\\
\;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{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 r48786 = x;
        double r48787 = 1.0;
        double r48788 = B;
        double r48789 = tan(r48788);
        double r48790 = r48787 / r48789;
        double r48791 = r48786 * r48790;
        double r48792 = -r48791;
        double r48793 = F;
        double r48794 = sin(r48788);
        double r48795 = r48793 / r48794;
        double r48796 = r48793 * r48793;
        double r48797 = 2.0;
        double r48798 = r48796 + r48797;
        double r48799 = r48797 * r48786;
        double r48800 = r48798 + r48799;
        double r48801 = r48787 / r48797;
        double r48802 = -r48801;
        double r48803 = pow(r48800, r48802);
        double r48804 = r48795 * r48803;
        double r48805 = r48792 + r48804;
        return r48805;
}

double f(double F, double B, double x) {
        double r48806 = F;
        double r48807 = -1.915744684244602e+23;
        bool r48808 = r48806 <= r48807;
        double r48809 = 1.0;
        double r48810 = x;
        double r48811 = B;
        double r48812 = cos(r48811);
        double r48813 = r48810 * r48812;
        double r48814 = sin(r48811);
        double r48815 = r48813 / r48814;
        double r48816 = r48809 * r48815;
        double r48817 = -r48816;
        double r48818 = 1.0;
        double r48819 = 2.0;
        double r48820 = pow(r48806, r48819);
        double r48821 = r48814 * r48820;
        double r48822 = r48818 / r48821;
        double r48823 = r48809 * r48822;
        double r48824 = r48818 / r48814;
        double r48825 = r48823 - r48824;
        double r48826 = r48817 + r48825;
        double r48827 = 1.2208528278557798e+27;
        bool r48828 = r48806 <= r48827;
        double r48829 = tan(r48811);
        double r48830 = r48810 * r48809;
        double r48831 = r48829 / r48830;
        double r48832 = r48818 / r48831;
        double r48833 = -r48832;
        double r48834 = r48806 * r48806;
        double r48835 = 2.0;
        double r48836 = r48834 + r48835;
        double r48837 = r48835 * r48810;
        double r48838 = r48836 + r48837;
        double r48839 = r48809 / r48835;
        double r48840 = -r48839;
        double r48841 = pow(r48838, r48840);
        double r48842 = r48841 / r48814;
        double r48843 = r48806 * r48842;
        double r48844 = r48833 + r48843;
        double r48845 = r48809 / r48829;
        double r48846 = r48810 * r48845;
        double r48847 = -r48846;
        double r48848 = r48824 - r48823;
        double r48849 = r48847 + r48848;
        double r48850 = r48828 ? r48844 : r48849;
        double r48851 = r48808 ? r48826 : r48850;
        return r48851;
}

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.915744684244602e+23

    1. Initial program 26.9

      \[\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 div-inv26.9

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

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

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

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

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

    if -1.915744684244602e+23 < F < 1.2208528278557798e+27

    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. Using strategy rm
    3. Applied div-inv0.5

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

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

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

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

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

    if 1.2208528278557798e+27 < F

    1. Initial program 27.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. Taylor expanded around inf 0.2

      \[\leadsto \left(-x \cdot \frac{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.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.91574468424460201 \cdot 10^{23}:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 1.2208528278557798 \cdot 10^{27}:\\ \;\;\;\;\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{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 2020047 
(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))))))