Average Error: 13.6 → 0.3
Time: 34.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 -7995080292970857:\\ \;\;\;\;\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 50.98469419077626696434890618547797203064:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos 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 -7995080292970857:\\
\;\;\;\;\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 50.98469419077626696434890618547797203064:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos 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 r59276 = x;
        double r59277 = 1.0;
        double r59278 = B;
        double r59279 = tan(r59278);
        double r59280 = r59277 / r59279;
        double r59281 = r59276 * r59280;
        double r59282 = -r59281;
        double r59283 = F;
        double r59284 = sin(r59278);
        double r59285 = r59283 / r59284;
        double r59286 = r59283 * r59283;
        double r59287 = 2.0;
        double r59288 = r59286 + r59287;
        double r59289 = r59287 * r59276;
        double r59290 = r59288 + r59289;
        double r59291 = r59277 / r59287;
        double r59292 = -r59291;
        double r59293 = pow(r59290, r59292);
        double r59294 = r59285 * r59293;
        double r59295 = r59282 + r59294;
        return r59295;
}

double f(double F, double B, double x) {
        double r59296 = F;
        double r59297 = -7995080292970857.0;
        bool r59298 = r59296 <= r59297;
        double r59299 = x;
        double r59300 = 1.0;
        double r59301 = r59299 * r59300;
        double r59302 = B;
        double r59303 = tan(r59302);
        double r59304 = r59301 / r59303;
        double r59305 = -r59304;
        double r59306 = sin(r59302);
        double r59307 = 2.0;
        double r59308 = pow(r59296, r59307);
        double r59309 = r59306 * r59308;
        double r59310 = r59300 / r59309;
        double r59311 = -1.0;
        double r59312 = r59311 / r59306;
        double r59313 = r59310 + r59312;
        double r59314 = r59305 + r59313;
        double r59315 = 50.98469419077627;
        bool r59316 = r59296 <= r59315;
        double r59317 = r59301 / r59306;
        double r59318 = cos(r59302);
        double r59319 = r59317 * r59318;
        double r59320 = -r59319;
        double r59321 = r59296 * r59296;
        double r59322 = 2.0;
        double r59323 = r59321 + r59322;
        double r59324 = r59322 * r59299;
        double r59325 = r59323 + r59324;
        double r59326 = r59300 / r59322;
        double r59327 = -r59326;
        double r59328 = pow(r59325, r59327);
        double r59329 = r59296 * r59328;
        double r59330 = r59329 / r59306;
        double r59331 = r59320 + r59330;
        double r59332 = 1.0;
        double r59333 = r59332 / r59306;
        double r59334 = r59333 - r59310;
        double r59335 = r59320 + r59334;
        double r59336 = r59316 ? r59331 : r59335;
        double r59337 = r59298 ? r59314 : r59336;
        return r59337;
}

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 < -7995080292970857.0

    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. Using strategy rm
    3. Applied div-inv25.3

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

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

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

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

    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 div-inv0.4

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

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

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

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

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\sin B} \cdot \cos 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}}\]

    if 50.98469419077627 < F

    1. Initial program 25.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 div-inv25.5

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

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

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\]
    10. Applied associate-/r/19.4

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\sin B} \cdot \cos B}\right) + F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\]
    11. Taylor expanded around inf 0.3

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

      \[\leadsto \left(-\frac{x \cdot 1}{\sin B} \cdot \cos 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.3

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

Reproduce

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