Average Error: 14.3 → 0.2
Time: 12.0s
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 -9.69079147007961829 \cdot 10^{125}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\frac{\frac{1}{F}}{F} - 1}{\sin B}\\ \mathbf{elif}\;F \le 2.6571035656186667 \cdot 10^{53}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot 1}{\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) + \frac{1 - \frac{\frac{1}{F}}{F}}{\sin 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 -9.69079147007961829 \cdot 10^{125}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\frac{\frac{1}{F}}{F} - 1}{\sin B}\\

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

\end{array}
double f(double F, double B, double x) {
        double r44700 = x;
        double r44701 = 1.0;
        double r44702 = B;
        double r44703 = tan(r44702);
        double r44704 = r44701 / r44703;
        double r44705 = r44700 * r44704;
        double r44706 = -r44705;
        double r44707 = F;
        double r44708 = sin(r44702);
        double r44709 = r44707 / r44708;
        double r44710 = r44707 * r44707;
        double r44711 = 2.0;
        double r44712 = r44710 + r44711;
        double r44713 = r44711 * r44700;
        double r44714 = r44712 + r44713;
        double r44715 = r44701 / r44711;
        double r44716 = -r44715;
        double r44717 = pow(r44714, r44716);
        double r44718 = r44709 * r44717;
        double r44719 = r44706 + r44718;
        return r44719;
}

double f(double F, double B, double x) {
        double r44720 = F;
        double r44721 = -9.690791470079618e+125;
        bool r44722 = r44720 <= r44721;
        double r44723 = x;
        double r44724 = 1.0;
        double r44725 = r44723 * r44724;
        double r44726 = B;
        double r44727 = tan(r44726);
        double r44728 = r44725 / r44727;
        double r44729 = -r44728;
        double r44730 = r44724 / r44720;
        double r44731 = r44730 / r44720;
        double r44732 = 1.0;
        double r44733 = r44731 - r44732;
        double r44734 = sin(r44726);
        double r44735 = r44733 / r44734;
        double r44736 = r44729 + r44735;
        double r44737 = 2.6571035656186667e+53;
        bool r44738 = r44720 <= r44737;
        double r44739 = r44720 * r44732;
        double r44740 = r44720 * r44720;
        double r44741 = 2.0;
        double r44742 = r44740 + r44741;
        double r44743 = r44741 * r44723;
        double r44744 = r44742 + r44743;
        double r44745 = r44724 / r44741;
        double r44746 = pow(r44744, r44745);
        double r44747 = r44734 * r44746;
        double r44748 = r44739 / r44747;
        double r44749 = r44729 + r44748;
        double r44750 = r44732 - r44731;
        double r44751 = r44750 / r44734;
        double r44752 = r44729 + r44751;
        double r44753 = r44738 ? r44749 : r44752;
        double r44754 = r44722 ? r44736 : r44753;
        return r44754;
}

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 < -9.690791470079618e+125

    1. Initial program 38.0

      \[\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 associate-*l/31.9

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

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

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

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

    if -9.690791470079618e+125 < F < 2.6571035656186667e+53

    1. Initial program 1.3

      \[\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 associate-*l/0.4

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

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

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

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

      \[\leadsto \left(-\frac{x \cdot 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)}}}\]

    if 2.6571035656186667e+53 < F

    1. Initial program 29.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 associate-*l/23.5

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

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

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

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

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

Reproduce

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