Average Error: 13.9 → 0.2
Time: 1.1m
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 -506492498426377024:\\ \;\;\;\;\left(\frac{\frac{1}{\sin B}}{F \cdot F} + \frac{-1}{\sin B}\right) + \frac{-1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \le 86.69108830173802004992467118427157402039:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(\frac{1}{2}\right)}} + \frac{-1 \cdot x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot \left(F \cdot F\right)}\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 -506492498426377024:\\
\;\;\;\;\left(\frac{\frac{1}{\sin B}}{F \cdot F} + \frac{-1}{\sin B}\right) + \frac{-1 \cdot x}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r2190372 = x;
        double r2190373 = 1.0;
        double r2190374 = B;
        double r2190375 = tan(r2190374);
        double r2190376 = r2190373 / r2190375;
        double r2190377 = r2190372 * r2190376;
        double r2190378 = -r2190377;
        double r2190379 = F;
        double r2190380 = sin(r2190374);
        double r2190381 = r2190379 / r2190380;
        double r2190382 = r2190379 * r2190379;
        double r2190383 = 2.0;
        double r2190384 = r2190382 + r2190383;
        double r2190385 = r2190383 * r2190372;
        double r2190386 = r2190384 + r2190385;
        double r2190387 = r2190373 / r2190383;
        double r2190388 = -r2190387;
        double r2190389 = pow(r2190386, r2190388);
        double r2190390 = r2190381 * r2190389;
        double r2190391 = r2190378 + r2190390;
        return r2190391;
}

double f(double F, double B, double x) {
        double r2190392 = F;
        double r2190393 = -5.06492498426377e+17;
        bool r2190394 = r2190392 <= r2190393;
        double r2190395 = 1.0;
        double r2190396 = B;
        double r2190397 = sin(r2190396);
        double r2190398 = r2190395 / r2190397;
        double r2190399 = r2190392 * r2190392;
        double r2190400 = r2190398 / r2190399;
        double r2190401 = -1.0;
        double r2190402 = r2190401 / r2190397;
        double r2190403 = r2190400 + r2190402;
        double r2190404 = x;
        double r2190405 = r2190395 * r2190404;
        double r2190406 = -r2190405;
        double r2190407 = tan(r2190396);
        double r2190408 = r2190406 / r2190407;
        double r2190409 = r2190403 + r2190408;
        double r2190410 = 86.69108830173802;
        bool r2190411 = r2190392 <= r2190410;
        double r2190412 = r2190392 / r2190397;
        double r2190413 = 2.0;
        double r2190414 = r2190399 + r2190413;
        double r2190415 = r2190404 * r2190413;
        double r2190416 = r2190414 + r2190415;
        double r2190417 = r2190395 / r2190413;
        double r2190418 = pow(r2190416, r2190417);
        double r2190419 = r2190412 / r2190418;
        double r2190420 = r2190419 + r2190408;
        double r2190421 = 1.0;
        double r2190422 = r2190421 / r2190397;
        double r2190423 = r2190397 * r2190399;
        double r2190424 = r2190395 / r2190423;
        double r2190425 = r2190422 - r2190424;
        double r2190426 = r2190425 + r2190408;
        double r2190427 = r2190411 ? r2190420 : r2190426;
        double r2190428 = r2190394 ? r2190409 : r2190427;
        return r2190428;
}

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 < -5.06492498426377e+17

    1. Initial program 26.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 associate-*r/26.7

      \[\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)}\]
    4. 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)}\]
    5. Simplified0.2

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

    if -5.06492498426377e+17 < F < 86.69108830173802

    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 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)}\]
    4. Using strategy rm
    5. Applied pow-neg0.3

      \[\leadsto \left(-\frac{x \cdot 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)}}}\]
    6. Applied un-div-inv0.3

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

    if 86.69108830173802 < F

    1. Initial program 24.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. Using strategy rm
    3. Applied associate-*r/24.5

      \[\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)}\]
    4. Using strategy rm
    5. Applied pow-neg24.5

      \[\leadsto \left(-\frac{x \cdot 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)}}}\]
    6. Applied frac-times18.4

      \[\leadsto \left(-\frac{x \cdot 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)}}}\]
    7. Simplified18.4

      \[\leadsto \left(-\frac{x \cdot 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)}}\]
    8. Simplified18.4

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)} \cdot \sin B}}\]
    9. Using strategy rm
    10. Applied div-inv18.4

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{F \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)} \cdot \sin B}}\]
    11. 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)}\]
    12. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))