Average Error: 13.9 → 0.8
Time: 35.0s
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.6482932881161788 \cdot 10^{121}:\\ \;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{{F}^{2} \cdot \sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 18380437.495112307:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{{F}^{2} \cdot \sin B}\right) - \frac{x \cdot 1}{\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 -2.6482932881161788 \cdot 10^{121}:\\
\;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{{F}^{2} \cdot \sin B}\right) - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r50415 = x;
        double r50416 = 1.0;
        double r50417 = B;
        double r50418 = tan(r50417);
        double r50419 = r50416 / r50418;
        double r50420 = r50415 * r50419;
        double r50421 = -r50420;
        double r50422 = F;
        double r50423 = sin(r50417);
        double r50424 = r50422 / r50423;
        double r50425 = r50422 * r50422;
        double r50426 = 2.0;
        double r50427 = r50425 + r50426;
        double r50428 = r50426 * r50415;
        double r50429 = r50427 + r50428;
        double r50430 = r50416 / r50426;
        double r50431 = -r50430;
        double r50432 = pow(r50429, r50431);
        double r50433 = r50424 * r50432;
        double r50434 = r50421 + r50433;
        return r50434;
}

double f(double F, double B, double x) {
        double r50435 = F;
        double r50436 = -2.648293288116179e+121;
        bool r50437 = r50435 <= r50436;
        double r50438 = -1.0;
        double r50439 = B;
        double r50440 = sin(r50439);
        double r50441 = r50438 / r50440;
        double r50442 = 1.0;
        double r50443 = 2.0;
        double r50444 = pow(r50435, r50443);
        double r50445 = r50444 * r50440;
        double r50446 = r50442 / r50445;
        double r50447 = r50441 + r50446;
        double r50448 = x;
        double r50449 = r50448 * r50442;
        double r50450 = tan(r50439);
        double r50451 = r50449 / r50450;
        double r50452 = r50447 - r50451;
        double r50453 = 18380437.495112307;
        bool r50454 = r50435 <= r50453;
        double r50455 = r50435 / r50440;
        double r50456 = r50435 * r50435;
        double r50457 = 2.0;
        double r50458 = r50456 + r50457;
        double r50459 = r50457 * r50448;
        double r50460 = r50458 + r50459;
        double r50461 = r50442 / r50457;
        double r50462 = pow(r50460, r50461);
        double r50463 = r50455 / r50462;
        double r50464 = r50463 - r50451;
        double r50465 = 1.0;
        double r50466 = r50465 / r50440;
        double r50467 = r50466 - r50446;
        double r50468 = r50467 - r50451;
        double r50469 = r50454 ? r50464 : r50468;
        double r50470 = r50437 ? r50452 : r50469;
        return r50470;
}

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.648293288116179e+121

    1. Initial program 35.0

      \[\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. Simplified35.0

      \[\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 associate-*r/34.9

      \[\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}}\]
    5. Using strategy rm
    6. Applied pow-neg34.9

      \[\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)}}} - \frac{x \cdot 1}{\tan B}\]
    7. Applied un-div-inv34.9

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

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

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

    if -2.648293288116179e+121 < F < 18380437.495112307

    1. Initial program 1.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. Simplified1.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. Using strategy rm
    4. Applied associate-*r/1.4

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

      \[\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)}}} - \frac{x \cdot 1}{\tan B}\]
    7. Applied un-div-inv1.3

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

    if 18380437.495112307 < F

    1. Initial program 25.8

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

      \[\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 associate-*r/25.8

      \[\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}}\]
    5. Taylor expanded around inf 0.2

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

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

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

Reproduce

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