Average Error: 14.1 → 0.2
Time: 22.1s
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 -2.0168921937716552 \cdot 10^{24}:\\ \;\;\;\;\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 139199781315741.5:\\ \;\;\;\;\left(-\frac{\left(x \cdot 1\right) \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}\\ \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 -2.0168921937716552 \cdot 10^{24}:\\
\;\;\;\;\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 139199781315741.5:\\
\;\;\;\;\left(-\frac{\left(x \cdot 1\right) \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}\\

\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 r65 = x;
        double r66 = 1.0;
        double r67 = B;
        double r68 = tan(r67);
        double r69 = r66 / r68;
        double r70 = r65 * r69;
        double r71 = -r70;
        double r72 = F;
        double r73 = sin(r67);
        double r74 = r72 / r73;
        double r75 = r72 * r72;
        double r76 = 2.0;
        double r77 = r75 + r76;
        double r78 = r76 * r65;
        double r79 = r77 + r78;
        double r80 = r66 / r76;
        double r81 = -r80;
        double r82 = pow(r79, r81);
        double r83 = r74 * r82;
        double r84 = r71 + r83;
        return r84;
}

double f(double F, double B, double x) {
        double r85 = F;
        double r86 = -2.0168921937716552e+24;
        bool r87 = r85 <= r86;
        double r88 = x;
        double r89 = 1.0;
        double r90 = r88 * r89;
        double r91 = B;
        double r92 = tan(r91);
        double r93 = r90 / r92;
        double r94 = -r93;
        double r95 = 1.0;
        double r96 = sin(r91);
        double r97 = 2.0;
        double r98 = pow(r85, r97);
        double r99 = r96 * r98;
        double r100 = r95 / r99;
        double r101 = r89 * r100;
        double r102 = r95 / r96;
        double r103 = r101 - r102;
        double r104 = r94 + r103;
        double r105 = 139199781315741.5;
        bool r106 = r85 <= r105;
        double r107 = cos(r91);
        double r108 = r90 * r107;
        double r109 = r108 / r96;
        double r110 = -r109;
        double r111 = r85 * r85;
        double r112 = 2.0;
        double r113 = r111 + r112;
        double r114 = r112 * r88;
        double r115 = r113 + r114;
        double r116 = r89 / r112;
        double r117 = -r116;
        double r118 = pow(r115, r117);
        double r119 = r118 / r96;
        double r120 = r85 * r119;
        double r121 = r110 + r120;
        double r122 = r102 - r101;
        double r123 = r94 + r122;
        double r124 = r106 ? r121 : r123;
        double r125 = r87 ? r104 : r124;
        return r125;
}

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 < -2.0168921937716552e+24

    1. Initial program 27.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 div-inv27.3

      \[\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*21.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. Simplified21.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. Using strategy rm
    7. Applied associate-*r/21.7

      \[\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. 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 -2.0168921937716552e+24 < F < 139199781315741.5

    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 div-inv0.4

      \[\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 tan-quot0.3

      \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\]
    10. Applied associate-/r/0.3

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

      \[\leadsto \left(-\color{blue}{\frac{\left(x \cdot 1\right) \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}\]

    if 139199781315741.5 < F

    1. Initial program 25.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 div-inv25.2

      \[\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*19.8

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

      \[\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/19.7

      \[\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. 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 -2.0168921937716552 \cdot 10^{24}:\\ \;\;\;\;\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 139199781315741.5:\\ \;\;\;\;\left(-\frac{\left(x \cdot 1\right) \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}\\ \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 2020025 +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))))))