Average Error: 13.9 → 0.2
Time: 37.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 -2.906001815670825 \cdot 10^{71}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 12064.6890623585441:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \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}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\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.906001815670825 \cdot 10^{71}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\

\mathbf{elif}\;F \le 12064.6890623585441:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \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}\\

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

\end{array}
double f(double F, double B, double x) {
        double r83699 = x;
        double r83700 = 1.0;
        double r83701 = B;
        double r83702 = tan(r83701);
        double r83703 = r83700 / r83702;
        double r83704 = r83699 * r83703;
        double r83705 = -r83704;
        double r83706 = F;
        double r83707 = sin(r83701);
        double r83708 = r83706 / r83707;
        double r83709 = r83706 * r83706;
        double r83710 = 2.0;
        double r83711 = r83709 + r83710;
        double r83712 = r83710 * r83699;
        double r83713 = r83711 + r83712;
        double r83714 = r83700 / r83710;
        double r83715 = -r83714;
        double r83716 = pow(r83713, r83715);
        double r83717 = r83708 * r83716;
        double r83718 = r83705 + r83717;
        return r83718;
}

double f(double F, double B, double x) {
        double r83719 = F;
        double r83720 = -2.906001815670825e+71;
        bool r83721 = r83719 <= r83720;
        double r83722 = x;
        double r83723 = 1.0;
        double r83724 = B;
        double r83725 = tan(r83724);
        double r83726 = r83723 / r83725;
        double r83727 = r83722 * r83726;
        double r83728 = -r83727;
        double r83729 = sin(r83724);
        double r83730 = 2.0;
        double r83731 = pow(r83719, r83730);
        double r83732 = r83729 * r83731;
        double r83733 = r83723 / r83732;
        double r83734 = 1.0;
        double r83735 = r83734 / r83729;
        double r83736 = r83733 - r83735;
        double r83737 = r83728 + r83736;
        double r83738 = 12064.689062358544;
        bool r83739 = r83719 <= r83738;
        double r83740 = r83722 * r83723;
        double r83741 = r83740 / r83725;
        double r83742 = -r83741;
        double r83743 = 2.0;
        double r83744 = fma(r83719, r83719, r83743);
        double r83745 = fma(r83743, r83722, r83744);
        double r83746 = r83723 / r83743;
        double r83747 = pow(r83745, r83746);
        double r83748 = r83747 * r83729;
        double r83749 = r83719 / r83748;
        double r83750 = r83742 + r83749;
        double r83751 = r83735 - r83733;
        double r83752 = r83728 + r83751;
        double r83753 = r83739 ? r83750 : r83752;
        double r83754 = r83721 ? r83737 : r83753;
        return r83754;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -2.906001815670825e+71

    1. Initial program 31.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. Taylor expanded around -inf 0.2

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

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

    if -2.906001815670825e+71 < F < 12064.689062358544

    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. Using strategy rm
    3. Applied associate-*l/0.4

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

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

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \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)}}} \cdot F\right) \cdot \frac{1}{\sin B}\]
    11. Applied associate-*l/0.3

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

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

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

    if 12064.689062358544 < F

    1. Initial program 24.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. Taylor expanded around inf 0.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -2.906001815670825 \cdot 10^{71}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 12064.6890623585441:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \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}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \end{array}\]

Reproduce

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