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

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

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

\end{array}
double f(double F, double B, double x) {
        double r46205 = x;
        double r46206 = 1.0;
        double r46207 = B;
        double r46208 = tan(r46207);
        double r46209 = r46206 / r46208;
        double r46210 = r46205 * r46209;
        double r46211 = -r46210;
        double r46212 = F;
        double r46213 = sin(r46207);
        double r46214 = r46212 / r46213;
        double r46215 = r46212 * r46212;
        double r46216 = 2.0;
        double r46217 = r46215 + r46216;
        double r46218 = r46216 * r46205;
        double r46219 = r46217 + r46218;
        double r46220 = r46206 / r46216;
        double r46221 = -r46220;
        double r46222 = pow(r46219, r46221);
        double r46223 = r46214 * r46222;
        double r46224 = r46211 + r46223;
        return r46224;
}

double f(double F, double B, double x) {
        double r46225 = F;
        double r46226 = -51018.23700738416;
        bool r46227 = r46225 <= r46226;
        double r46228 = -1.0;
        double r46229 = B;
        double r46230 = sin(r46229);
        double r46231 = r46228 / r46230;
        double r46232 = 1.0;
        double r46233 = 2.0;
        double r46234 = pow(r46225, r46233);
        double r46235 = r46230 * r46234;
        double r46236 = r46232 / r46235;
        double r46237 = r46231 + r46236;
        double r46238 = x;
        double r46239 = r46232 * r46238;
        double r46240 = tan(r46229);
        double r46241 = r46239 / r46240;
        double r46242 = r46237 - r46241;
        double r46243 = 13415.641954219034;
        bool r46244 = r46225 <= r46243;
        double r46245 = r46225 / r46230;
        double r46246 = r46225 * r46225;
        double r46247 = 2.0;
        double r46248 = r46246 + r46247;
        double r46249 = r46247 * r46238;
        double r46250 = r46248 + r46249;
        double r46251 = r46232 / r46247;
        double r46252 = -r46251;
        double r46253 = pow(r46250, r46252);
        double r46254 = r46245 * r46253;
        double r46255 = cos(r46229);
        double r46256 = r46238 * r46255;
        double r46257 = r46256 / r46230;
        double r46258 = r46232 * r46257;
        double r46259 = r46254 - r46258;
        double r46260 = 1.0;
        double r46261 = r46260 / r46230;
        double r46262 = r46261 - r46236;
        double r46263 = r46262 - r46241;
        double r46264 = r46244 ? r46259 : r46263;
        double r46265 = r46227 ? r46242 : r46264;
        return r46265;
}

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

    1. Initial program 24.1

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

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times18.5

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified18.5

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

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

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

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

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

    if -51018.23700738416 < F < 13415.641954219034

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

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

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

    if 13415.641954219034 < 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. Simplified25.3

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times19.8

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified19.8

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

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

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

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

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

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

Reproduce

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