Average Error: 13.4 → 0.2
Time: 1.4m
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 -3.320148733636293 \cdot 10^{+41}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 24648470.869023856:\\ \;\;\;\;\frac{{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}^{\frac{1}{2}} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{4}}\right)}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{\frac{1}{\sin B}}{F \cdot F}\right) - \frac{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 -3.320148733636293 \cdot 10^{+41}:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r5089336 = x;
        double r5089337 = 1.0;
        double r5089338 = B;
        double r5089339 = tan(r5089338);
        double r5089340 = r5089337 / r5089339;
        double r5089341 = r5089336 * r5089340;
        double r5089342 = -r5089341;
        double r5089343 = F;
        double r5089344 = sin(r5089338);
        double r5089345 = r5089343 / r5089344;
        double r5089346 = r5089343 * r5089343;
        double r5089347 = 2.0;
        double r5089348 = r5089346 + r5089347;
        double r5089349 = r5089347 * r5089336;
        double r5089350 = r5089348 + r5089349;
        double r5089351 = r5089337 / r5089347;
        double r5089352 = -r5089351;
        double r5089353 = pow(r5089350, r5089352);
        double r5089354 = r5089345 * r5089353;
        double r5089355 = r5089342 + r5089354;
        return r5089355;
}

double f(double F, double B, double x) {
        double r5089356 = F;
        double r5089357 = -3.320148733636293e+41;
        bool r5089358 = r5089356 <= r5089357;
        double r5089359 = 1.0;
        double r5089360 = r5089356 * r5089356;
        double r5089361 = r5089359 / r5089360;
        double r5089362 = r5089361 - r5089359;
        double r5089363 = B;
        double r5089364 = sin(r5089363);
        double r5089365 = r5089362 / r5089364;
        double r5089366 = x;
        double r5089367 = tan(r5089363);
        double r5089368 = r5089366 / r5089367;
        double r5089369 = r5089365 - r5089368;
        double r5089370 = 24648470.869023856;
        bool r5089371 = r5089356 <= r5089370;
        double r5089372 = 2.0;
        double r5089373 = r5089360 + r5089372;
        double r5089374 = r5089372 * r5089366;
        double r5089375 = r5089373 + r5089374;
        double r5089376 = -0.5;
        double r5089377 = pow(r5089375, r5089376);
        double r5089378 = 0.5;
        double r5089379 = pow(r5089377, r5089378);
        double r5089380 = -0.25;
        double r5089381 = pow(r5089375, r5089380);
        double r5089382 = r5089356 * r5089381;
        double r5089383 = r5089379 * r5089382;
        double r5089384 = r5089383 / r5089364;
        double r5089385 = r5089384 - r5089368;
        double r5089386 = r5089359 / r5089364;
        double r5089387 = r5089386 / r5089360;
        double r5089388 = r5089386 - r5089387;
        double r5089389 = r5089388 - r5089368;
        double r5089390 = r5089371 ? r5089385 : r5089389;
        double r5089391 = r5089358 ? r5089369 : r5089390;
        return r5089391;
}

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 < -3.320148733636293e+41

    1. Initial program 26.0

      \[\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. Simplified20.8

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B}\]
    7. Simplified0.2

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

    if -3.320148733636293e+41 < F < 24648470.869023856

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

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

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

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

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

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

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

    if 24648470.869023856 < F

    1. Initial program 25.0

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -3.320148733636293 \cdot 10^{+41}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 24648470.869023856:\\ \;\;\;\;\frac{{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}^{\frac{1}{2}} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{4}}\right)}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{\frac{1}{\sin B}}{F \cdot F}\right) - \frac{x}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2019124 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))