Average Error: 13.9 → 0.3
Time: 10.4s
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 -5.7648000314577582 \cdot 10^{21}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \cdot \left(\frac{\frac{1}{F}}{F} - 1\right)\\ \mathbf{elif}\;F \le 21.3414842217350404:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B} - \frac{\frac{1}{\sin B}}{{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 -5.7648000314577582 \cdot 10^{21}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \cdot \left(\frac{\frac{1}{F}}{F} - 1\right)\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r38477 = x;
        double r38478 = 1.0;
        double r38479 = B;
        double r38480 = tan(r38479);
        double r38481 = r38478 / r38480;
        double r38482 = r38477 * r38481;
        double r38483 = -r38482;
        double r38484 = F;
        double r38485 = sin(r38479);
        double r38486 = r38484 / r38485;
        double r38487 = r38484 * r38484;
        double r38488 = 2.0;
        double r38489 = r38487 + r38488;
        double r38490 = r38488 * r38477;
        double r38491 = r38489 + r38490;
        double r38492 = r38478 / r38488;
        double r38493 = -r38492;
        double r38494 = pow(r38491, r38493);
        double r38495 = r38486 * r38494;
        double r38496 = r38483 + r38495;
        return r38496;
}

double f(double F, double B, double x) {
        double r38497 = F;
        double r38498 = -5.764800031457758e+21;
        bool r38499 = r38497 <= r38498;
        double r38500 = x;
        double r38501 = 1.0;
        double r38502 = r38500 * r38501;
        double r38503 = B;
        double r38504 = tan(r38503);
        double r38505 = r38502 / r38504;
        double r38506 = -r38505;
        double r38507 = 1.0;
        double r38508 = sin(r38503);
        double r38509 = r38507 / r38508;
        double r38510 = r38501 / r38497;
        double r38511 = r38510 / r38497;
        double r38512 = r38511 - r38507;
        double r38513 = r38509 * r38512;
        double r38514 = r38506 + r38513;
        double r38515 = 21.34148422173504;
        bool r38516 = r38497 <= r38515;
        double r38517 = cos(r38503);
        double r38518 = r38500 * r38517;
        double r38519 = r38518 / r38508;
        double r38520 = r38501 * r38519;
        double r38521 = -r38520;
        double r38522 = r38497 / r38508;
        double r38523 = r38497 * r38497;
        double r38524 = 2.0;
        double r38525 = r38523 + r38524;
        double r38526 = r38524 * r38500;
        double r38527 = r38525 + r38526;
        double r38528 = r38501 / r38524;
        double r38529 = -r38528;
        double r38530 = pow(r38527, r38529);
        double r38531 = r38522 * r38530;
        double r38532 = r38521 + r38531;
        double r38533 = r38501 / r38508;
        double r38534 = 2.0;
        double r38535 = pow(r38497, r38534);
        double r38536 = r38533 / r38535;
        double r38537 = r38509 - r38536;
        double r38538 = r38506 + r38537;
        double r38539 = r38516 ? r38532 : r38538;
        double r38540 = r38499 ? r38514 : r38539;
        return r38540;
}

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 < -5.764800031457758e+21

    1. Initial program 26.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 pow-neg26.4

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    4. Applied frac-times20.8

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified20.8

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity20.7

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

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

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

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

    if -5.764800031457758e+21 < F < 21.34148422173504

    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. Taylor expanded around inf 0.4

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

    if 21.34148422173504 < F

    1. Initial program 24.6

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    4. Applied frac-times18.8

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified18.8

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity18.8

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

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

      \[\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)}\]
    12. Simplified0.3

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

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

Reproduce

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