Average Error: 13.3 → 0.2
Time: 31.6s
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 -4284481847442338870824750136032897412366000:\\ \;\;\;\;\frac{F \cdot \left(\frac{1}{{F}^{3}} - \frac{1}{F}\right)}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 312418.127475462271831929683685302734375:\\ \;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{1}{F \cdot F}}{\sin B} - \frac{x \cdot 1}{\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 -4284481847442338870824750136032897412366000:\\
\;\;\;\;\frac{F \cdot \left(\frac{1}{{F}^{3}} - \frac{1}{F}\right)}{\sin B} - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r50646 = x;
        double r50647 = 1.0;
        double r50648 = B;
        double r50649 = tan(r50648);
        double r50650 = r50647 / r50649;
        double r50651 = r50646 * r50650;
        double r50652 = -r50651;
        double r50653 = F;
        double r50654 = sin(r50648);
        double r50655 = r50653 / r50654;
        double r50656 = r50653 * r50653;
        double r50657 = 2.0;
        double r50658 = r50656 + r50657;
        double r50659 = r50657 * r50646;
        double r50660 = r50658 + r50659;
        double r50661 = r50647 / r50657;
        double r50662 = -r50661;
        double r50663 = pow(r50660, r50662);
        double r50664 = r50655 * r50663;
        double r50665 = r50652 + r50664;
        return r50665;
}

double f(double F, double B, double x) {
        double r50666 = F;
        double r50667 = -4.284481847442339e+42;
        bool r50668 = r50666 <= r50667;
        double r50669 = 1.0;
        double r50670 = 3.0;
        double r50671 = pow(r50666, r50670);
        double r50672 = r50669 / r50671;
        double r50673 = 1.0;
        double r50674 = r50673 / r50666;
        double r50675 = r50672 - r50674;
        double r50676 = r50666 * r50675;
        double r50677 = B;
        double r50678 = sin(r50677);
        double r50679 = r50676 / r50678;
        double r50680 = x;
        double r50681 = r50680 * r50669;
        double r50682 = tan(r50677);
        double r50683 = r50681 / r50682;
        double r50684 = r50679 - r50683;
        double r50685 = 312418.1274754623;
        bool r50686 = r50666 <= r50685;
        double r50687 = r50666 * r50666;
        double r50688 = 2.0;
        double r50689 = r50687 + r50688;
        double r50690 = r50688 * r50680;
        double r50691 = r50689 + r50690;
        double r50692 = r50669 / r50688;
        double r50693 = pow(r50691, r50692);
        double r50694 = r50666 / r50693;
        double r50695 = r50694 / r50678;
        double r50696 = r50695 - r50683;
        double r50697 = r50669 / r50687;
        double r50698 = r50673 - r50697;
        double r50699 = r50698 / r50678;
        double r50700 = r50699 - r50683;
        double r50701 = r50686 ? r50696 : r50700;
        double r50702 = r50668 ? r50684 : r50701;
        return r50702;
}

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 < -4.284481847442339e+42

    1. Initial program 27.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. Simplified27.6

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

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

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

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

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

    if -4.284481847442339e+42 < F < 312418.1274754623

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

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

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

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

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

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

    if 312418.1274754623 < F

    1. Initial program 23.9

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

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

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

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

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

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

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

Reproduce

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