Average Error: 13.9 → 0.2
Time: 40.9s
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 -4.105717990897647267375097044942416442893 \cdot 10^{51}:\\ \;\;\;\;\left(\frac{\frac{1}{\sin B}}{F \cdot F} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 51126349.92642568051815032958984375:\\ \;\;\;\;\frac{F}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)} \cdot \sin B} - \cos B \cdot \frac{x \cdot 1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{\frac{1}{\sin B}}{F \cdot F}\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 -4.105717990897647267375097044942416442893 \cdot 10^{51}:\\
\;\;\;\;\left(\frac{\frac{1}{\sin B}}{F \cdot F} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r2378684 = x;
        double r2378685 = 1.0;
        double r2378686 = B;
        double r2378687 = tan(r2378686);
        double r2378688 = r2378685 / r2378687;
        double r2378689 = r2378684 * r2378688;
        double r2378690 = -r2378689;
        double r2378691 = F;
        double r2378692 = sin(r2378686);
        double r2378693 = r2378691 / r2378692;
        double r2378694 = r2378691 * r2378691;
        double r2378695 = 2.0;
        double r2378696 = r2378694 + r2378695;
        double r2378697 = r2378695 * r2378684;
        double r2378698 = r2378696 + r2378697;
        double r2378699 = r2378685 / r2378695;
        double r2378700 = -r2378699;
        double r2378701 = pow(r2378698, r2378700);
        double r2378702 = r2378693 * r2378701;
        double r2378703 = r2378690 + r2378702;
        return r2378703;
}

double f(double F, double B, double x) {
        double r2378704 = F;
        double r2378705 = -4.105717990897647e+51;
        bool r2378706 = r2378704 <= r2378705;
        double r2378707 = 1.0;
        double r2378708 = B;
        double r2378709 = sin(r2378708);
        double r2378710 = r2378707 / r2378709;
        double r2378711 = r2378704 * r2378704;
        double r2378712 = r2378710 / r2378711;
        double r2378713 = 1.0;
        double r2378714 = r2378713 / r2378709;
        double r2378715 = r2378712 - r2378714;
        double r2378716 = x;
        double r2378717 = r2378716 * r2378707;
        double r2378718 = tan(r2378708);
        double r2378719 = r2378717 / r2378718;
        double r2378720 = r2378715 - r2378719;
        double r2378721 = 51126349.92642568;
        bool r2378722 = r2378704 <= r2378721;
        double r2378723 = 2.0;
        double r2378724 = fma(r2378716, r2378723, r2378723);
        double r2378725 = fma(r2378704, r2378704, r2378724);
        double r2378726 = r2378707 / r2378723;
        double r2378727 = pow(r2378725, r2378726);
        double r2378728 = r2378727 * r2378709;
        double r2378729 = r2378704 / r2378728;
        double r2378730 = cos(r2378708);
        double r2378731 = r2378717 / r2378709;
        double r2378732 = r2378730 * r2378731;
        double r2378733 = r2378729 - r2378732;
        double r2378734 = r2378714 - r2378712;
        double r2378735 = r2378734 - r2378719;
        double r2378736 = r2378722 ? r2378733 : r2378735;
        double r2378737 = r2378706 ? r2378720 : r2378736;
        return r2378737;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -4.105717990897647e+51

    1. Initial program 29.3

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

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

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

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

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

      \[\leadsto \frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} - \color{blue}{\frac{1 \cdot x}{\tan B}}\]
    9. Taylor expanded around -inf 0.2

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

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

    if -4.105717990897647e+51 < F < 51126349.92642568

    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. Simplified0.4

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

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

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

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

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

      \[\leadsto \frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} - \frac{1 \cdot x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
    11. Applied associate-/r/0.3

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

    if 51126349.92642568 < F

    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. Simplified18.7

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

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

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

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

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

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

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

Reproduce

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