Average Error: 31.5 → 0.0
Time: 9.7s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.027483001552600198197362502128271444235 \lor \neg \left(x \le 0.02800287222077786977725288863894093083218\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.027483001552600198197362502128271444235 \lor \neg \left(x \le 0.02800287222077786977725288863894093083218\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\

\mathbf{else}:\\
\;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\

\end{array}
double f(double x) {
        double r13971 = x;
        double r13972 = sin(r13971);
        double r13973 = r13971 - r13972;
        double r13974 = tan(r13971);
        double r13975 = r13971 - r13974;
        double r13976 = r13973 / r13975;
        return r13976;
}

double f(double x) {
        double r13977 = x;
        double r13978 = -0.027483001552600198;
        bool r13979 = r13977 <= r13978;
        double r13980 = 0.02800287222077787;
        bool r13981 = r13977 <= r13980;
        double r13982 = !r13981;
        bool r13983 = r13979 || r13982;
        double r13984 = sin(r13977);
        double r13985 = r13977 - r13984;
        double r13986 = tan(r13977);
        double r13987 = r13977 - r13986;
        double r13988 = r13985 / r13987;
        double r13989 = 0.225;
        double r13990 = 2.0;
        double r13991 = pow(r13977, r13990);
        double r13992 = r13989 * r13991;
        double r13993 = 0.009642857142857142;
        double r13994 = 4.0;
        double r13995 = pow(r13977, r13994);
        double r13996 = r13993 * r13995;
        double r13997 = 0.5;
        double r13998 = r13996 + r13997;
        double r13999 = r13992 - r13998;
        double r14000 = r13983 ? r13988 : r13999;
        return r14000;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -0.027483001552600198 or 0.02800287222077787 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]

    if -0.027483001552600198 < x < 0.02800287222077787

    1. Initial program 63.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied flip--63.3

      \[\leadsto \frac{\color{blue}{\frac{x \cdot x - \sin x \cdot \sin x}{x + \sin x}}}{x - \tan x}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt63.3

      \[\leadsto \frac{\frac{x \cdot x - \color{blue}{\left(\left(\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}\right) \cdot \sqrt[3]{\sin x}\right)} \cdot \sin x}{x + \sin x}}{x - \tan x}\]
    6. Applied associate-*l*63.3

      \[\leadsto \frac{\frac{x \cdot x - \color{blue}{\left(\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}\right) \cdot \left(\sqrt[3]{\sin x} \cdot \sin x\right)}}{x + \sin x}}{x - \tan x}\]
    7. Simplified63.3

      \[\leadsto \frac{\frac{x \cdot x - \left(\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}\right) \cdot \color{blue}{{\left(\sqrt[3]{\sin x}\right)}^{4}}}{x + \sin x}}{x - \tan x}\]
    8. Taylor expanded around 0 0.0

      \[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.027483001552600198197362502128271444235 \lor \neg \left(x \le 0.02800287222077786977725288863894093083218\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019362 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))