Average Error: 14.2 → 0.2
Time: 12.3s
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 -9195186657059580928:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{{\left(\frac{1}{{-1}^{1}}\right)}^{1} \cdot \sin B}\\ \mathbf{elif}\;F \le 102483788.350631415843963623046875:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}{F}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin 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 -9195186657059580928:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{{\left(\frac{1}{{-1}^{1}}\right)}^{1} \cdot \sin B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r38764 = x;
        double r38765 = 1.0;
        double r38766 = B;
        double r38767 = tan(r38766);
        double r38768 = r38765 / r38767;
        double r38769 = r38764 * r38768;
        double r38770 = -r38769;
        double r38771 = F;
        double r38772 = sin(r38766);
        double r38773 = r38771 / r38772;
        double r38774 = r38771 * r38771;
        double r38775 = 2.0;
        double r38776 = r38774 + r38775;
        double r38777 = r38775 * r38764;
        double r38778 = r38776 + r38777;
        double r38779 = r38765 / r38775;
        double r38780 = -r38779;
        double r38781 = pow(r38778, r38780);
        double r38782 = r38773 * r38781;
        double r38783 = r38770 + r38782;
        return r38783;
}

double f(double F, double B, double x) {
        double r38784 = F;
        double r38785 = -9.195186657059581e+18;
        bool r38786 = r38784 <= r38785;
        double r38787 = x;
        double r38788 = 1.0;
        double r38789 = r38787 * r38788;
        double r38790 = B;
        double r38791 = tan(r38790);
        double r38792 = r38789 / r38791;
        double r38793 = -r38792;
        double r38794 = 1.0;
        double r38795 = -1.0;
        double r38796 = pow(r38795, r38788);
        double r38797 = r38794 / r38796;
        double r38798 = pow(r38797, r38788);
        double r38799 = sin(r38790);
        double r38800 = r38798 * r38799;
        double r38801 = r38794 / r38800;
        double r38802 = r38793 + r38801;
        double r38803 = 102483788.35063142;
        bool r38804 = r38784 <= r38803;
        double r38805 = r38784 * r38784;
        double r38806 = 2.0;
        double r38807 = r38805 + r38806;
        double r38808 = r38806 * r38787;
        double r38809 = r38807 + r38808;
        double r38810 = r38788 / r38806;
        double r38811 = pow(r38809, r38810);
        double r38812 = r38799 * r38811;
        double r38813 = r38812 / r38784;
        double r38814 = r38794 / r38813;
        double r38815 = r38793 + r38814;
        double r38816 = r38794 / r38799;
        double r38817 = r38793 + r38816;
        double r38818 = r38804 ? r38815 : r38817;
        double r38819 = r38786 ? r38802 : r38818;
        return r38819;
}

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

    1. Initial program 26.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 pow-neg26.6

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    4. Applied frac-times20.7

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified20.7

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. Using strategy rm
    9. Applied clear-num20.6

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

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

    if -9.195186657059581e+18 < F < 102483788.35063142

    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. Using strategy rm
    3. Applied pow-neg0.5

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified0.4

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. Using strategy rm
    9. Applied clear-num0.3

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

    if 102483788.35063142 < F

    1. Initial program 25.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. Using strategy rm
    3. Applied pow-neg25.7

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    4. Applied frac-times19.3

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified19.3

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. Using strategy rm
    9. Applied clear-num19.2

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

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

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

Reproduce

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