Average Error: 13.8 → 0.3
Time: 12.5s
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 -8.2736045584269209 \cdot 10^{38}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\mathsf{fma}\left({\left(\frac{1}{{-1}^{1}}\right)}^{1}, \sin B \cdot F, 1 \cdot \left({\left(\frac{1}{{-1}^{1} \cdot {F}^{1}}\right)}^{1} \cdot \sin B\right)\right)}\\ \mathbf{elif}\;F \le 63011.2659022378575:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B \cdot \left({\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(\frac{1}{2}\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\mathsf{fma}\left(1, \sin B \cdot {\left(\frac{1}{{F}^{1}}\right)}^{1}, \sin B \cdot F\right)}\\ \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 -8.2736045584269209 \cdot 10^{38}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\mathsf{fma}\left({\left(\frac{1}{{-1}^{1}}\right)}^{1}, \sin B \cdot F, 1 \cdot \left({\left(\frac{1}{{-1}^{1} \cdot {F}^{1}}\right)}^{1} \cdot \sin B\right)\right)}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r40407 = x;
        double r40408 = 1.0;
        double r40409 = B;
        double r40410 = tan(r40409);
        double r40411 = r40408 / r40410;
        double r40412 = r40407 * r40411;
        double r40413 = -r40412;
        double r40414 = F;
        double r40415 = sin(r40409);
        double r40416 = r40414 / r40415;
        double r40417 = r40414 * r40414;
        double r40418 = 2.0;
        double r40419 = r40417 + r40418;
        double r40420 = r40418 * r40407;
        double r40421 = r40419 + r40420;
        double r40422 = r40408 / r40418;
        double r40423 = -r40422;
        double r40424 = pow(r40421, r40423);
        double r40425 = r40416 * r40424;
        double r40426 = r40413 + r40425;
        return r40426;
}

double f(double F, double B, double x) {
        double r40427 = F;
        double r40428 = -8.273604558426921e+38;
        bool r40429 = r40427 <= r40428;
        double r40430 = x;
        double r40431 = 1.0;
        double r40432 = r40430 * r40431;
        double r40433 = B;
        double r40434 = tan(r40433);
        double r40435 = r40432 / r40434;
        double r40436 = -r40435;
        double r40437 = 1.0;
        double r40438 = -1.0;
        double r40439 = pow(r40438, r40431);
        double r40440 = r40437 / r40439;
        double r40441 = pow(r40440, r40431);
        double r40442 = sin(r40433);
        double r40443 = r40442 * r40427;
        double r40444 = pow(r40427, r40431);
        double r40445 = r40439 * r40444;
        double r40446 = r40437 / r40445;
        double r40447 = pow(r40446, r40431);
        double r40448 = r40447 * r40442;
        double r40449 = r40431 * r40448;
        double r40450 = fma(r40441, r40443, r40449);
        double r40451 = r40427 / r40450;
        double r40452 = r40436 + r40451;
        double r40453 = 63011.26590223786;
        bool r40454 = r40427 <= r40453;
        double r40455 = r40427 * r40427;
        double r40456 = 2.0;
        double r40457 = r40455 + r40456;
        double r40458 = r40456 * r40430;
        double r40459 = r40457 + r40458;
        double r40460 = sqrt(r40459);
        double r40461 = r40431 / r40456;
        double r40462 = pow(r40460, r40461);
        double r40463 = r40462 * r40462;
        double r40464 = r40442 * r40463;
        double r40465 = r40427 / r40464;
        double r40466 = r40436 + r40465;
        double r40467 = r40437 / r40444;
        double r40468 = pow(r40467, r40431);
        double r40469 = r40442 * r40468;
        double r40470 = fma(r40431, r40469, r40443);
        double r40471 = r40427 / r40470;
        double r40472 = r40436 + r40471;
        double r40473 = r40454 ? r40466 : r40472;
        double r40474 = r40429 ? r40452 : r40473;
        return r40474;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -8.273604558426921e+38

    1. Initial program 27.9

      \[\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 pow-neg27.9

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

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

      \[\leadsto \left(-x \cdot \frac{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)}}\]
    6. Using strategy rm
    7. Applied associate-*r/21.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)}}\]
    8. Taylor expanded around -inf 0.2

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

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

    if -8.273604558426921e+38 < F < 63011.26590223786

    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 pow-neg0.5

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

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

      \[\leadsto \left(-x \cdot \frac{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)}}\]
    6. Using strategy rm
    7. 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)}}\]
    8. Using strategy rm
    9. Applied add-sqr-sqrt0.3

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B \cdot {\color{blue}{\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x} \cdot \sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}}^{\left(\frac{1}{2}\right)}}\]
    10. Applied unpow-prod-down0.3

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

    if 63011.26590223786 < F

    1. Initial program 24.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 pow-neg24.7

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

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

      \[\leadsto \left(-x \cdot \frac{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)}}\]
    6. Using strategy rm
    7. Applied associate-*r/19.1

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

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

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

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

Reproduce

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