Average Error: 13.5 → 0.2
Time: 18.3s
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.0995950722645005 \cdot 10^{23}:\\ \;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)\\ \mathbf{elif}\;F \le 15392.9094647980946:\\ \;\;\;\;\frac{F}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)} \cdot \sin B} + \left(-\frac{x \cdot 1}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) + \left(-\frac{x \cdot 1}{\tan B}\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 -2.0995950722645005 \cdot 10^{23}:\\
\;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r52490 = x;
        double r52491 = 1.0;
        double r52492 = B;
        double r52493 = tan(r52492);
        double r52494 = r52491 / r52493;
        double r52495 = r52490 * r52494;
        double r52496 = -r52495;
        double r52497 = F;
        double r52498 = sin(r52492);
        double r52499 = r52497 / r52498;
        double r52500 = r52497 * r52497;
        double r52501 = 2.0;
        double r52502 = r52500 + r52501;
        double r52503 = r52501 * r52490;
        double r52504 = r52502 + r52503;
        double r52505 = r52491 / r52501;
        double r52506 = -r52505;
        double r52507 = pow(r52504, r52506);
        double r52508 = r52499 * r52507;
        double r52509 = r52496 + r52508;
        return r52509;
}

double f(double F, double B, double x) {
        double r52510 = F;
        double r52511 = -2.0995950722645005e+23;
        bool r52512 = r52510 <= r52511;
        double r52513 = -1.0;
        double r52514 = B;
        double r52515 = sin(r52514);
        double r52516 = r52513 / r52515;
        double r52517 = 1.0;
        double r52518 = 2.0;
        double r52519 = pow(r52510, r52518);
        double r52520 = r52515 * r52519;
        double r52521 = r52517 / r52520;
        double r52522 = r52516 + r52521;
        double r52523 = x;
        double r52524 = r52523 * r52517;
        double r52525 = tan(r52514);
        double r52526 = r52524 / r52525;
        double r52527 = -r52526;
        double r52528 = r52522 + r52527;
        double r52529 = 15392.909464798095;
        bool r52530 = r52510 <= r52529;
        double r52531 = 2.0;
        double r52532 = fma(r52510, r52510, r52531);
        double r52533 = fma(r52531, r52523, r52532);
        double r52534 = r52517 / r52531;
        double r52535 = pow(r52533, r52534);
        double r52536 = r52535 * r52515;
        double r52537 = r52510 / r52536;
        double r52538 = r52537 + r52527;
        double r52539 = 1.0;
        double r52540 = r52539 / r52515;
        double r52541 = r52540 - r52521;
        double r52542 = r52541 + r52527;
        double r52543 = r52530 ? r52538 : r52542;
        double r52544 = r52512 ? r52528 : r52543;
        return r52544;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -2.0995950722645005e+23

    1. Initial program 24.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. Simplified24.9

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

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

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

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

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

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

    if -2.0995950722645005e+23 < F < 15392.909464798095

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{F \cdot \frac{1}{\sin B}}}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} + \left(-\frac{x \cdot 1}{\tan B}\right)\]
    12. Applied associate-/l*0.3

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

      \[\leadsto \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}} + \left(-\frac{x \cdot 1}{\tan B}\right)\]

    if 15392.909464798095 < F

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020042 +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))))))