Average Error: 13.4 → 0.4
Time: 36.8s
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 -0.2991882649788563:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 9.410170631177428 \cdot 10^{+60}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\sin B} \cdot \cos 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 -0.2991882649788563:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \le 9.410170631177428 \cdot 10^{+60}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\sin B} \cdot \cos 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 r1168137 = x;
        double r1168138 = 1.0;
        double r1168139 = B;
        double r1168140 = tan(r1168139);
        double r1168141 = r1168138 / r1168140;
        double r1168142 = r1168137 * r1168141;
        double r1168143 = -r1168142;
        double r1168144 = F;
        double r1168145 = sin(r1168139);
        double r1168146 = r1168144 / r1168145;
        double r1168147 = r1168144 * r1168144;
        double r1168148 = 2.0;
        double r1168149 = r1168147 + r1168148;
        double r1168150 = r1168148 * r1168137;
        double r1168151 = r1168149 + r1168150;
        double r1168152 = r1168138 / r1168148;
        double r1168153 = -r1168152;
        double r1168154 = pow(r1168151, r1168153);
        double r1168155 = r1168146 * r1168154;
        double r1168156 = r1168143 + r1168155;
        return r1168156;
}

double f(double F, double B, double x) {
        double r1168157 = F;
        double r1168158 = -0.2991882649788563;
        bool r1168159 = r1168157 <= r1168158;
        double r1168160 = 1.0;
        double r1168161 = r1168157 * r1168157;
        double r1168162 = r1168160 / r1168161;
        double r1168163 = r1168162 - r1168160;
        double r1168164 = B;
        double r1168165 = sin(r1168164);
        double r1168166 = r1168163 / r1168165;
        double r1168167 = x;
        double r1168168 = tan(r1168164);
        double r1168169 = r1168167 / r1168168;
        double r1168170 = r1168166 - r1168169;
        double r1168171 = 9.410170631177428e+60;
        bool r1168172 = r1168157 <= r1168171;
        double r1168173 = 2.0;
        double r1168174 = r1168161 + r1168173;
        double r1168175 = r1168173 * r1168167;
        double r1168176 = r1168174 + r1168175;
        double r1168177 = -0.5;
        double r1168178 = pow(r1168176, r1168177);
        double r1168179 = r1168157 / r1168165;
        double r1168180 = r1168178 * r1168179;
        double r1168181 = r1168167 / r1168165;
        double r1168182 = cos(r1168164);
        double r1168183 = r1168181 * r1168182;
        double r1168184 = r1168180 - r1168183;
        double r1168185 = r1168160 - r1168162;
        double r1168186 = r1168185 / r1168165;
        double r1168187 = r1168186 - r1168169;
        double r1168188 = r1168172 ? r1168184 : r1168187;
        double r1168189 = r1168159 ? r1168170 : r1168188;
        return r1168189;
}

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

    1. Initial program 24.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. Simplified24.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 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}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B}\]
    6. Simplified0.4

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

    if -0.2991882649788563 < F < 9.410170631177428e+60

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

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

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

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

    if 9.410170631177428e+60 < F

    1. Initial program 29.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. Simplified29.2

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

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

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

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

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

Reproduce

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