Average Error: 14.0 → 0.2
Time: 16.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 -67836704772650.625:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right)\\ \mathbf{elif}\;F \le 16387.0021157664778:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{0}}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 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 -67836704772650.625:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 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 r53140 = x;
        double r53141 = 1.0;
        double r53142 = B;
        double r53143 = tan(r53142);
        double r53144 = r53141 / r53143;
        double r53145 = r53140 * r53144;
        double r53146 = -r53145;
        double r53147 = F;
        double r53148 = sin(r53142);
        double r53149 = r53147 / r53148;
        double r53150 = r53147 * r53147;
        double r53151 = 2.0;
        double r53152 = r53150 + r53151;
        double r53153 = r53151 * r53140;
        double r53154 = r53152 + r53153;
        double r53155 = r53141 / r53151;
        double r53156 = -r53155;
        double r53157 = pow(r53154, r53156);
        double r53158 = r53149 * r53157;
        double r53159 = r53146 + r53158;
        return r53159;
}

double f(double F, double B, double x) {
        double r53160 = F;
        double r53161 = -67836704772650.625;
        bool r53162 = r53160 <= r53161;
        double r53163 = x;
        double r53164 = 1.0;
        double r53165 = r53163 * r53164;
        double r53166 = B;
        double r53167 = tan(r53166);
        double r53168 = r53165 / r53167;
        double r53169 = -r53168;
        double r53170 = sin(r53166);
        double r53171 = 2.0;
        double r53172 = pow(r53160, r53171);
        double r53173 = r53170 * r53172;
        double r53174 = r53164 / r53173;
        double r53175 = -1.0;
        double r53176 = r53175 / r53170;
        double r53177 = r53174 + r53176;
        double r53178 = r53169 + r53177;
        double r53179 = 16387.002115766478;
        bool r53180 = r53160 <= r53179;
        double r53181 = 2.0;
        double r53182 = fma(r53160, r53160, r53181);
        double r53183 = fma(r53181, r53163, r53182);
        double r53184 = 0.0;
        double r53185 = pow(r53183, r53184);
        double r53186 = r53160 * r53185;
        double r53187 = r53164 / r53181;
        double r53188 = pow(r53183, r53187);
        double r53189 = r53170 * r53188;
        double r53190 = r53186 / r53189;
        double r53191 = r53169 + r53190;
        double r53192 = 1.0;
        double r53193 = r53192 / r53170;
        double r53194 = r53193 - r53174;
        double r53195 = r53169 + r53194;
        double r53196 = r53180 ? r53191 : r53195;
        double r53197 = r53162 ? r53178 : r53196;
        return r53197;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -67836704772650.625

    1. Initial program 25.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 associate-*l/19.6

      \[\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. Simplified19.6

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

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

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

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

    if -67836704772650.625 < F < 16387.002115766478

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

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

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

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

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

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

    if 16387.002115766478 < F

    1. Initial program 25.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 associate-*l/19.2

      \[\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. Simplified19.2

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

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

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

      \[\leadsto \left(-\frac{x \cdot 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 -67836704772650.625:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B \cdot {F}^{2}} + \frac{-1}{\sin B}\right)\\ \mathbf{elif}\;F \le 16387.0021157664778:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{0}}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \end{array}\]

Reproduce

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