Average Error: 13.6 → 0.2
Time: 12.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 -5388.191798255752473778557032346725463867:\\ \;\;\;\;\left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 5397.157867877478565787896513938903808594:\\ \;\;\;\;\frac{F}{\sin B \cdot {\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)}^{\left(\sqrt[3]{\frac{1}{2}}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{1 \cdot \left(\sin B \cdot {\left(\frac{1}{{F}^{1}}\right)}^{1}\right) + \sin B \cdot F} - \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 -5388.191798255752473778557032346725463867:\\
\;\;\;\;\left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r37766 = x;
        double r37767 = 1.0;
        double r37768 = B;
        double r37769 = tan(r37768);
        double r37770 = r37767 / r37769;
        double r37771 = r37766 * r37770;
        double r37772 = -r37771;
        double r37773 = F;
        double r37774 = sin(r37768);
        double r37775 = r37773 / r37774;
        double r37776 = r37773 * r37773;
        double r37777 = 2.0;
        double r37778 = r37776 + r37777;
        double r37779 = r37777 * r37766;
        double r37780 = r37778 + r37779;
        double r37781 = r37767 / r37777;
        double r37782 = -r37781;
        double r37783 = pow(r37780, r37782);
        double r37784 = r37775 * r37783;
        double r37785 = r37772 + r37784;
        return r37785;
}

double f(double F, double B, double x) {
        double r37786 = F;
        double r37787 = -5388.1917982557525;
        bool r37788 = r37786 <= r37787;
        double r37789 = 1.0;
        double r37790 = 1.0;
        double r37791 = B;
        double r37792 = sin(r37791);
        double r37793 = 2.0;
        double r37794 = pow(r37786, r37793);
        double r37795 = r37792 * r37794;
        double r37796 = r37790 / r37795;
        double r37797 = r37789 * r37796;
        double r37798 = r37790 / r37792;
        double r37799 = r37797 - r37798;
        double r37800 = x;
        double r37801 = r37800 * r37789;
        double r37802 = tan(r37791);
        double r37803 = r37801 / r37802;
        double r37804 = r37799 - r37803;
        double r37805 = 5397.157867877479;
        bool r37806 = r37786 <= r37805;
        double r37807 = r37786 * r37786;
        double r37808 = 2.0;
        double r37809 = r37807 + r37808;
        double r37810 = r37808 * r37800;
        double r37811 = r37809 + r37810;
        double r37812 = r37789 / r37808;
        double r37813 = cbrt(r37812);
        double r37814 = r37813 * r37813;
        double r37815 = pow(r37811, r37814);
        double r37816 = pow(r37815, r37813);
        double r37817 = r37792 * r37816;
        double r37818 = r37786 / r37817;
        double r37819 = r37818 - r37803;
        double r37820 = pow(r37786, r37789);
        double r37821 = r37790 / r37820;
        double r37822 = pow(r37821, r37789);
        double r37823 = r37792 * r37822;
        double r37824 = r37789 * r37823;
        double r37825 = r37792 * r37786;
        double r37826 = r37824 + r37825;
        double r37827 = r37786 / r37826;
        double r37828 = r37827 - r37803;
        double r37829 = r37806 ? r37819 : r37828;
        double r37830 = r37788 ? r37804 : r37829;
        return r37830;
}

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 < -5388.1917982557525

    1. Initial program 24.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. Simplified24.3

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

      \[\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-times18.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. Simplified18.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/18.5

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

    if -5388.1917982557525 < F < 5397.157867877479

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

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

      \[\leadsto \frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{1}{2}}\right)}}} - \frac{x \cdot 1}{\tan B}\]
    11. Applied pow-unpow0.3

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

    if 5397.157867877479 < F

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

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

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

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

Reproduce

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