Average Error: 13.6 → 0.3
Time: 31.7s
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 -5.615906575338096 \cdot 10^{+35}:\\ \;\;\;\;\frac{1}{\left(-\frac{\sin B}{F} \cdot \frac{x}{F}\right) - \sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 3174.6489492657015:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{4}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{4}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B + \frac{\sin B}{F} \cdot \frac{x}{F}} - \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 -5.615906575338096 \cdot 10^{+35}:\\
\;\;\;\;\frac{1}{\left(-\frac{\sin B}{F} \cdot \frac{x}{F}\right) - \sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \le 3174.6489492657015:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{4}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{4}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B + \frac{\sin B}{F} \cdot \frac{x}{F}} - \frac{x}{\tan B}\\

\end{array}
double f(double F, double B, double x) {
        double r740384 = x;
        double r740385 = 1.0;
        double r740386 = B;
        double r740387 = tan(r740386);
        double r740388 = r740385 / r740387;
        double r740389 = r740384 * r740388;
        double r740390 = -r740389;
        double r740391 = F;
        double r740392 = sin(r740386);
        double r740393 = r740391 / r740392;
        double r740394 = r740391 * r740391;
        double r740395 = 2.0;
        double r740396 = r740394 + r740395;
        double r740397 = r740395 * r740384;
        double r740398 = r740396 + r740397;
        double r740399 = r740385 / r740395;
        double r740400 = -r740399;
        double r740401 = pow(r740398, r740400);
        double r740402 = r740393 * r740401;
        double r740403 = r740390 + r740402;
        return r740403;
}

double f(double F, double B, double x) {
        double r740404 = F;
        double r740405 = -5.615906575338096e+35;
        bool r740406 = r740404 <= r740405;
        double r740407 = 1.0;
        double r740408 = B;
        double r740409 = sin(r740408);
        double r740410 = r740409 / r740404;
        double r740411 = x;
        double r740412 = r740411 / r740404;
        double r740413 = r740410 * r740412;
        double r740414 = -r740413;
        double r740415 = r740414 - r740409;
        double r740416 = r740407 / r740415;
        double r740417 = tan(r740408);
        double r740418 = r740411 / r740417;
        double r740419 = r740416 - r740418;
        double r740420 = 3174.6489492657015;
        bool r740421 = r740404 <= r740420;
        double r740422 = 2.0;
        double r740423 = fma(r740404, r740404, r740422);
        double r740424 = fma(r740411, r740422, r740423);
        double r740425 = -0.25;
        double r740426 = pow(r740424, r740425);
        double r740427 = r740426 * r740426;
        double r740428 = r740427 / r740410;
        double r740429 = r740428 - r740418;
        double r740430 = r740409 + r740413;
        double r740431 = r740407 / r740430;
        double r740432 = r740431 - r740418;
        double r740433 = r740421 ? r740429 : r740432;
        double r740434 = r740406 ? r740419 : r740433;
        return r740434;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -5.615906575338096e+35

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

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-*r/21.9

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B}} - \frac{x}{\tan B}\]
    5. Using strategy rm
    6. Applied sqr-pow22.0

      \[\leadsto \frac{\color{blue}{\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot F}{\sin B} - \frac{x}{\tan B}\]
    7. Using strategy rm
    8. Applied clear-num22.0

      \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right) \cdot F}}} - \frac{x}{\tan B}\]
    9. Simplified21.9

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

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

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

    if -5.615906575338096e+35 < F < 3174.6489492657015

    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(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-*r/0.3

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B}} - \frac{x}{\tan B}\]
    5. Using strategy rm
    6. Applied sqr-pow0.3

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

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

    if 3174.6489492657015 < F

    1. Initial program 25.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. Simplified25.1

      \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied associate-*r/18.9

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B}} - \frac{x}{\tan B}\]
    5. Using strategy rm
    6. Applied sqr-pow19.0

      \[\leadsto \frac{\color{blue}{\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot F}{\sin B} - \frac{x}{\tan B}\]
    7. Using strategy rm
    8. Applied clear-num19.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -5.615906575338096 \cdot 10^{+35}:\\ \;\;\;\;\frac{1}{\left(-\frac{\sin B}{F} \cdot \frac{x}{F}\right) - \sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 3174.6489492657015:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{4}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{4}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B + \frac{\sin B}{F} \cdot \frac{x}{F}} - \frac{x}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2019154 +o rules:numerics
(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))))))