Average Error: 13.7 → 0.3
Time: 1.3m
Precision: 64
\[\left(-x \cdot \frac{1.0}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2.0\right) + 2.0 \cdot x\right)}^{\left(-\frac{1.0}{2.0}\right)}\]
\[\begin{array}{l} \mathbf{if}\;F \le -9.104758834957999 \cdot 10^{+48}:\\ \;\;\;\;\left(\frac{1.0}{\sin B \cdot \left(F \cdot F\right)} - \frac{1}{\sin B}\right) - \frac{\cos B \cdot x}{\sin B} \cdot 1.0\\ \mathbf{elif}\;F \le 4.50828920393062 \cdot 10^{+21}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}} - \frac{x \cdot 1.0}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1.0}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{\cos B \cdot x}{\sin B} \cdot 1.0\\ \end{array}\]
\left(-x \cdot \frac{1.0}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2.0\right) + 2.0 \cdot x\right)}^{\left(-\frac{1.0}{2.0}\right)}
\begin{array}{l}
\mathbf{if}\;F \le -9.104758834957999 \cdot 10^{+48}:\\
\;\;\;\;\left(\frac{1.0}{\sin B \cdot \left(F \cdot F\right)} - \frac{1}{\sin B}\right) - \frac{\cos B \cdot x}{\sin B} \cdot 1.0\\

\mathbf{elif}\;F \le 4.50828920393062 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}} - \frac{x \cdot 1.0}{\tan B}\\

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

\end{array}
double f(double F, double B, double x) {
        double r2032190 = x;
        double r2032191 = 1.0;
        double r2032192 = B;
        double r2032193 = tan(r2032192);
        double r2032194 = r2032191 / r2032193;
        double r2032195 = r2032190 * r2032194;
        double r2032196 = -r2032195;
        double r2032197 = F;
        double r2032198 = sin(r2032192);
        double r2032199 = r2032197 / r2032198;
        double r2032200 = r2032197 * r2032197;
        double r2032201 = 2.0;
        double r2032202 = r2032200 + r2032201;
        double r2032203 = r2032201 * r2032190;
        double r2032204 = r2032202 + r2032203;
        double r2032205 = r2032191 / r2032201;
        double r2032206 = -r2032205;
        double r2032207 = pow(r2032204, r2032206);
        double r2032208 = r2032199 * r2032207;
        double r2032209 = r2032196 + r2032208;
        return r2032209;
}

double f(double F, double B, double x) {
        double r2032210 = F;
        double r2032211 = -9.104758834957999e+48;
        bool r2032212 = r2032210 <= r2032211;
        double r2032213 = 1.0;
        double r2032214 = B;
        double r2032215 = sin(r2032214);
        double r2032216 = r2032210 * r2032210;
        double r2032217 = r2032215 * r2032216;
        double r2032218 = r2032213 / r2032217;
        double r2032219 = 1.0;
        double r2032220 = r2032219 / r2032215;
        double r2032221 = r2032218 - r2032220;
        double r2032222 = cos(r2032214);
        double r2032223 = x;
        double r2032224 = r2032222 * r2032223;
        double r2032225 = r2032224 / r2032215;
        double r2032226 = r2032225 * r2032213;
        double r2032227 = r2032221 - r2032226;
        double r2032228 = 4.50828920393062e+21;
        bool r2032229 = r2032210 <= r2032228;
        double r2032230 = r2032210 / r2032215;
        double r2032231 = 2.0;
        double r2032232 = fma(r2032223, r2032231, r2032231);
        double r2032233 = fma(r2032210, r2032210, r2032232);
        double r2032234 = r2032213 / r2032231;
        double r2032235 = pow(r2032233, r2032234);
        double r2032236 = r2032230 / r2032235;
        double r2032237 = r2032223 * r2032213;
        double r2032238 = tan(r2032214);
        double r2032239 = r2032237 / r2032238;
        double r2032240 = r2032236 - r2032239;
        double r2032241 = r2032220 - r2032218;
        double r2032242 = r2032241 - r2032226;
        double r2032243 = r2032229 ? r2032240 : r2032242;
        double r2032244 = r2032212 ? r2032227 : r2032243;
        return r2032244;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -9.104758834957999e+48

    1. Initial program 28.7

      \[\left(-x \cdot \frac{1.0}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2.0\right) + 2.0 \cdot x\right)}^{\left(-\frac{1.0}{2.0}\right)}\]
    2. Simplified22.0

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

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

      \[\leadsto \frac{F}{\frac{\sin B}{\color{blue}{\frac{1}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}}}}} - \frac{1.0 \cdot x}{\tan B}\]
    7. 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.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}}} - \frac{1.0 \cdot x}{\tan B}\]
    8. Applied *-un-lft-identity21.9

      \[\leadsto \frac{\color{blue}{1 \cdot F}}{\frac{\sin B}{1} \cdot {\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}} - \frac{1.0 \cdot x}{\tan B}\]
    9. Applied times-frac21.9

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

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

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

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

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

    if -9.104758834957999e+48 < F < 4.50828920393062e+21

    1. Initial program 0.5

      \[\left(-x \cdot \frac{1.0}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2.0\right) + 2.0 \cdot x\right)}^{\left(-\frac{1.0}{2.0}\right)}\]
    2. Simplified0.4

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

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

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

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

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

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

    if 4.50828920393062e+21 < F

    1. Initial program 26.0

      \[\left(-x \cdot \frac{1.0}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2.0\right) + 2.0 \cdot x\right)}^{\left(-\frac{1.0}{2.0}\right)}\]
    2. Simplified20.0

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

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

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

      \[\leadsto \frac{F}{\color{blue}{\frac{\sin B}{1} \cdot {\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}}} - \frac{1.0 \cdot x}{\tan B}\]
    8. Applied *-un-lft-identity19.9

      \[\leadsto \frac{\color{blue}{1 \cdot F}}{\frac{\sin B}{1} \cdot {\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}} - \frac{1.0 \cdot x}{\tan B}\]
    9. Applied times-frac19.9

      \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{1}} \cdot \frac{F}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}}} - \frac{1.0 \cdot x}{\tan B}\]
    10. Simplified19.9

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -9.104758834957999 \cdot 10^{+48}:\\ \;\;\;\;\left(\frac{1.0}{\sin B \cdot \left(F \cdot F\right)} - \frac{1}{\sin B}\right) - \frac{\cos B \cdot x}{\sin B} \cdot 1.0\\ \mathbf{elif}\;F \le 4.50828920393062 \cdot 10^{+21}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2.0, 2.0\right)\right)\right)}^{\left(\frac{1.0}{2.0}\right)}} - \frac{x \cdot 1.0}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1.0}{\sin B \cdot \left(F \cdot F\right)}\right) - \frac{\cos B \cdot x}{\sin B} \cdot 1.0\\ \end{array}\]

Reproduce

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