Average Error: 13.5 → 0.2
Time: 33.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 -51018.23700738415936939418315887451171875:\\ \;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \le 13415.64195421903423266485333442687988281:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{1 \cdot x}{\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 -51018.23700738415936939418315887451171875:\\
\;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{1 \cdot x}{\tan B}\\

\mathbf{elif}\;F \le 13415.64195421903423266485333442687988281:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\

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

\end{array}
double f(double F, double B, double x) {
        double r46202 = x;
        double r46203 = 1.0;
        double r46204 = B;
        double r46205 = tan(r46204);
        double r46206 = r46203 / r46205;
        double r46207 = r46202 * r46206;
        double r46208 = -r46207;
        double r46209 = F;
        double r46210 = sin(r46204);
        double r46211 = r46209 / r46210;
        double r46212 = r46209 * r46209;
        double r46213 = 2.0;
        double r46214 = r46212 + r46213;
        double r46215 = r46213 * r46202;
        double r46216 = r46214 + r46215;
        double r46217 = r46203 / r46213;
        double r46218 = -r46217;
        double r46219 = pow(r46216, r46218);
        double r46220 = r46211 * r46219;
        double r46221 = r46208 + r46220;
        return r46221;
}

double f(double F, double B, double x) {
        double r46222 = F;
        double r46223 = -51018.23700738416;
        bool r46224 = r46222 <= r46223;
        double r46225 = -1.0;
        double r46226 = B;
        double r46227 = sin(r46226);
        double r46228 = r46225 / r46227;
        double r46229 = 1.0;
        double r46230 = 2.0;
        double r46231 = pow(r46222, r46230);
        double r46232 = r46227 * r46231;
        double r46233 = r46229 / r46232;
        double r46234 = r46228 + r46233;
        double r46235 = x;
        double r46236 = r46229 * r46235;
        double r46237 = tan(r46226);
        double r46238 = r46236 / r46237;
        double r46239 = r46234 - r46238;
        double r46240 = 13415.641954219034;
        bool r46241 = r46222 <= r46240;
        double r46242 = r46222 / r46227;
        double r46243 = r46222 * r46222;
        double r46244 = 2.0;
        double r46245 = r46243 + r46244;
        double r46246 = r46244 * r46235;
        double r46247 = r46245 + r46246;
        double r46248 = r46229 / r46244;
        double r46249 = -r46248;
        double r46250 = pow(r46247, r46249);
        double r46251 = r46242 * r46250;
        double r46252 = cos(r46226);
        double r46253 = r46235 * r46252;
        double r46254 = r46253 / r46227;
        double r46255 = r46229 * r46254;
        double r46256 = r46251 - r46255;
        double r46257 = 1.0;
        double r46258 = r46257 / r46227;
        double r46259 = r46258 - r46233;
        double r46260 = r46259 - r46238;
        double r46261 = r46241 ? r46256 : r46260;
        double r46262 = r46224 ? r46239 : r46261;
        return r46262;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

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

    1. Initial program 24.1

      \[\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.1

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

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

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

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

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

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

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

    if -51018.23700738416 < F < 13415.641954219034

    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}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}}\]
    3. Taylor expanded around inf 0.3

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

    if 13415.641954219034 < F

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\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 -51018.23700738415936939418315887451171875:\\ \;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \le 13415.64195421903423266485333442687988281:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{1 \cdot x}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2019326 
(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))))))