Average Error: 14.0 → 0.2
Time: 11.9s
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.256361684932917247611032252561428984411 \cdot 10^{119}:\\ \;\;\;\;\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 6846209.423334120772778987884521484375:\\ \;\;\;\;\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} - 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 -5.256361684932917247611032252561428984411 \cdot 10^{119}:\\
\;\;\;\;\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 6846209.423334120772778987884521484375:\\
\;\;\;\;\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} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\

\end{array}
double f(double F, double B, double x) {
        double r38631 = x;
        double r38632 = 1.0;
        double r38633 = B;
        double r38634 = tan(r38633);
        double r38635 = r38632 / r38634;
        double r38636 = r38631 * r38635;
        double r38637 = -r38636;
        double r38638 = F;
        double r38639 = sin(r38633);
        double r38640 = r38638 / r38639;
        double r38641 = r38638 * r38638;
        double r38642 = 2.0;
        double r38643 = r38641 + r38642;
        double r38644 = r38642 * r38631;
        double r38645 = r38643 + r38644;
        double r38646 = r38632 / r38642;
        double r38647 = -r38646;
        double r38648 = pow(r38645, r38647);
        double r38649 = r38640 * r38648;
        double r38650 = r38637 + r38649;
        return r38650;
}

double f(double F, double B, double x) {
        double r38651 = F;
        double r38652 = -5.256361684932917e+119;
        bool r38653 = r38651 <= r38652;
        double r38654 = x;
        double r38655 = 1.0;
        double r38656 = r38654 * r38655;
        double r38657 = B;
        double r38658 = tan(r38657);
        double r38659 = r38656 / r38658;
        double r38660 = -r38659;
        double r38661 = 1.0;
        double r38662 = sin(r38657);
        double r38663 = 2.0;
        double r38664 = pow(r38651, r38663);
        double r38665 = r38662 * r38664;
        double r38666 = r38661 / r38665;
        double r38667 = r38655 * r38666;
        double r38668 = r38661 / r38662;
        double r38669 = r38667 - r38668;
        double r38670 = r38660 + r38669;
        double r38671 = 6846209.423334121;
        bool r38672 = r38651 <= r38671;
        double r38673 = cos(r38657);
        double r38674 = r38654 * r38673;
        double r38675 = r38674 / r38662;
        double r38676 = r38655 * r38675;
        double r38677 = -r38676;
        double r38678 = r38651 * r38651;
        double r38679 = 2.0;
        double r38680 = r38678 + r38679;
        double r38681 = r38679 * r38654;
        double r38682 = r38680 + r38681;
        double r38683 = r38655 / r38679;
        double r38684 = pow(r38682, r38683);
        double r38685 = r38662 * r38684;
        double r38686 = r38651 / r38685;
        double r38687 = r38677 + r38686;
        double r38688 = r38668 - r38667;
        double r38689 = r38660 + r38688;
        double r38690 = r38672 ? r38687 : r38689;
        double r38691 = r38653 ? r38670 : r38690;
        return r38691;
}

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.256361684932917e+119

    1. Initial program 36.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. Using strategy rm
    3. Applied pow-neg36.1

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

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

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

      \[\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. 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 -5.256361684932917e+119 < F < 6846209.423334121

    1. Initial program 1.2

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

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

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

      \[\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. Taylor expanded around inf 0.3

      \[\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 6846209.423334121 < F

    1. Initial program 25.8

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

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

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

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

      \[\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. Taylor expanded around inf 0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -5.256361684932917247611032252561428984411 \cdot 10^{119}:\\ \;\;\;\;\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 6846209.423334120772778987884521484375:\\ \;\;\;\;\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} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019356 +o rules:numerics
(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))))))