Average Error: 13.9 → 1.2
Time: 13.5s
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 -2.937366932003985 \cdot 10^{69}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 3.70793572378502737 \cdot 10^{-27}:\\ \;\;\;\;\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + F \cdot \frac{{\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}{\tan B}\right) + \left(\frac{1}{\sin B} - 1 \cdot \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 -2.937366932003985 \cdot 10^{69}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\

\mathbf{elif}\;F \le 3.70793572378502737 \cdot 10^{-27}:\\
\;\;\;\;\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + F \cdot \frac{{\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}{\tan B}\right) + \left(\frac{1}{\sin B} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\

\end{array}
double f(double F, double B, double x) {
        double r48560 = x;
        double r48561 = 1.0;
        double r48562 = B;
        double r48563 = tan(r48562);
        double r48564 = r48561 / r48563;
        double r48565 = r48560 * r48564;
        double r48566 = -r48565;
        double r48567 = F;
        double r48568 = sin(r48562);
        double r48569 = r48567 / r48568;
        double r48570 = r48567 * r48567;
        double r48571 = 2.0;
        double r48572 = r48570 + r48571;
        double r48573 = r48571 * r48560;
        double r48574 = r48572 + r48573;
        double r48575 = r48561 / r48571;
        double r48576 = -r48575;
        double r48577 = pow(r48574, r48576);
        double r48578 = r48569 * r48577;
        double r48579 = r48566 + r48578;
        return r48579;
}

double f(double F, double B, double x) {
        double r48580 = F;
        double r48581 = -2.9373669320039848e+69;
        bool r48582 = r48580 <= r48581;
        double r48583 = x;
        double r48584 = 1.0;
        double r48585 = r48583 * r48584;
        double r48586 = B;
        double r48587 = tan(r48586);
        double r48588 = r48585 / r48587;
        double r48589 = -r48588;
        double r48590 = 1.0;
        double r48591 = sin(r48586);
        double r48592 = 2.0;
        double r48593 = pow(r48580, r48592);
        double r48594 = r48591 * r48593;
        double r48595 = r48590 / r48594;
        double r48596 = r48584 * r48595;
        double r48597 = r48590 / r48591;
        double r48598 = r48596 - r48597;
        double r48599 = r48589 + r48598;
        double r48600 = 3.7079357237850274e-27;
        bool r48601 = r48580 <= r48600;
        double r48602 = r48587 / r48585;
        double r48603 = r48590 / r48602;
        double r48604 = -r48603;
        double r48605 = r48580 * r48580;
        double r48606 = 2.0;
        double r48607 = r48605 + r48606;
        double r48608 = r48606 * r48583;
        double r48609 = r48607 + r48608;
        double r48610 = r48584 / r48606;
        double r48611 = -r48610;
        double r48612 = pow(r48609, r48611);
        double r48613 = r48612 / r48591;
        double r48614 = r48580 * r48613;
        double r48615 = r48604 + r48614;
        double r48616 = r48597 - r48596;
        double r48617 = r48589 + r48616;
        double r48618 = r48601 ? r48615 : r48617;
        double r48619 = r48582 ? r48599 : r48618;
        return r48619;
}

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 < -2.9373669320039848e+69

    1. Initial program 30.7

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

      \[\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*23.6

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

      \[\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/23.6

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

      \[\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)}\]

    if -2.9373669320039848e+69 < F < 3.7079357237850274e-27

    1. Initial program 0.7

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

      \[\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 clear-num0.4

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

    if 3.7079357237850274e-27 < F

    1. Initial program 23.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-inv23.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*18.2

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

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

      \[\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 3.4

      \[\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)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -2.937366932003985 \cdot 10^{69}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 3.70793572378502737 \cdot 10^{-27}:\\ \;\;\;\;\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + F \cdot \frac{{\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}{\tan B}\right) + \left(\frac{1}{\sin B} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \end{array}\]

Reproduce

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