Average Error: 30.9 → 0.0
Time: 12.9s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02894118494710049 \lor \neg \left(x \le 0.0280789751943332118\right):\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin 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.02894118494710049 \lor \neg \left(x \le 0.0280789751943332118\right):\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin 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 r9148 = x;
        double r9149 = sin(r9148);
        double r9150 = r9148 - r9149;
        double r9151 = tan(r9148);
        double r9152 = r9148 - r9151;
        double r9153 = r9150 / r9152;
        return r9153;
}

double f(double x) {
        double r9154 = x;
        double r9155 = -0.02894118494710049;
        bool r9156 = r9154 <= r9155;
        double r9157 = 0.028078975194333212;
        bool r9158 = r9154 <= r9157;
        double r9159 = !r9158;
        bool r9160 = r9156 || r9159;
        double r9161 = 1.0;
        double r9162 = tan(r9154);
        double r9163 = r9154 - r9162;
        double r9164 = sin(r9154);
        double r9165 = r9154 - r9164;
        double r9166 = r9163 / r9165;
        double r9167 = r9161 / r9166;
        double r9168 = 0.225;
        double r9169 = 2.0;
        double r9170 = pow(r9154, r9169);
        double r9171 = r9168 * r9170;
        double r9172 = 0.009642857142857142;
        double r9173 = 4.0;
        double r9174 = pow(r9154, r9173);
        double r9175 = r9172 * r9174;
        double r9176 = 0.5;
        double r9177 = r9175 + r9176;
        double r9178 = r9171 - r9177;
        double r9179 = r9160 ? r9167 : r9178;
        return r9179;
}

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.02894118494710049 or 0.028078975194333212 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied clear-num0.1

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}}\]

    if -0.02894118494710049 < x < 0.028078975194333212

    1. Initial program 63.1

      \[\frac{x - \sin x}{x - \tan x}\]
    2. 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.02894118494710049 \lor \neg \left(x \le 0.0280789751943332118\right):\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin 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 2020043 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))