Average Error: 14.0 → 0.2
Time: 32.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 -5781402953055721472:\\ \;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 1230529.51555462740361690521240234375:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \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 -5781402953055721472:\\
\;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r47621 = x;
        double r47622 = 1.0;
        double r47623 = B;
        double r47624 = tan(r47623);
        double r47625 = r47622 / r47624;
        double r47626 = r47621 * r47625;
        double r47627 = -r47626;
        double r47628 = F;
        double r47629 = sin(r47623);
        double r47630 = r47628 / r47629;
        double r47631 = r47628 * r47628;
        double r47632 = 2.0;
        double r47633 = r47631 + r47632;
        double r47634 = r47632 * r47621;
        double r47635 = r47633 + r47634;
        double r47636 = r47622 / r47632;
        double r47637 = -r47636;
        double r47638 = pow(r47635, r47637);
        double r47639 = r47630 * r47638;
        double r47640 = r47627 + r47639;
        return r47640;
}

double f(double F, double B, double x) {
        double r47641 = F;
        double r47642 = -5.781402953055721e+18;
        bool r47643 = r47641 <= r47642;
        double r47644 = -1.0;
        double r47645 = B;
        double r47646 = sin(r47645);
        double r47647 = r47644 / r47646;
        double r47648 = 1.0;
        double r47649 = 2.0;
        double r47650 = pow(r47641, r47649);
        double r47651 = r47646 * r47650;
        double r47652 = r47648 / r47651;
        double r47653 = r47647 + r47652;
        double r47654 = x;
        double r47655 = r47654 * r47648;
        double r47656 = tan(r47645);
        double r47657 = r47655 / r47656;
        double r47658 = r47653 - r47657;
        double r47659 = 1230529.5155546274;
        bool r47660 = r47641 <= r47659;
        double r47661 = r47641 / r47646;
        double r47662 = r47641 * r47641;
        double r47663 = 2.0;
        double r47664 = r47662 + r47663;
        double r47665 = r47663 * r47654;
        double r47666 = r47664 + r47665;
        double r47667 = r47648 / r47663;
        double r47668 = pow(r47666, r47667);
        double r47669 = r47661 / r47668;
        double r47670 = r47669 - r47657;
        double r47671 = 1.0;
        double r47672 = r47671 / r47646;
        double r47673 = r47672 - r47652;
        double r47674 = r47673 - r47657;
        double r47675 = r47660 ? r47670 : r47674;
        double r47676 = r47643 ? r47658 : r47675;
        return r47676;
}

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.781402953055721e+18

    1. Initial program 26.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. Simplified26.8

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times20.6

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified20.6

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/20.6

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

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

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

    if -5.781402953055721e+18 < F < 1230529.5155546274

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

      \[\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 pow-neg0.5

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times0.4

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified0.4

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/0.3

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

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

    if 1230529.5155546274 < F

    1. Initial program 25.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. Simplified25.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 pow-neg25.5

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times19.8

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified19.8

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/19.8

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right)} - \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 -5781402953055721472:\\ \;\;\;\;\left(\frac{-1}{\sin B} + \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 1230529.51555462740361690521240234375:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\ \end{array}\]

Reproduce

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