Average Error: 31.3 → 0.0
Time: 13.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0275654979361482401 \lor \neg \left(x \le 0.029125046562482146\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.0275654979361482401 \lor \neg \left(x \le 0.029125046562482146\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 r13171 = x;
        double r13172 = sin(r13171);
        double r13173 = r13171 - r13172;
        double r13174 = tan(r13171);
        double r13175 = r13171 - r13174;
        double r13176 = r13173 / r13175;
        return r13176;
}

double f(double x) {
        double r13177 = x;
        double r13178 = -0.02756549793614824;
        bool r13179 = r13177 <= r13178;
        double r13180 = 0.029125046562482146;
        bool r13181 = r13177 <= r13180;
        double r13182 = !r13181;
        bool r13183 = r13179 || r13182;
        double r13184 = 1.0;
        double r13185 = tan(r13177);
        double r13186 = r13177 - r13185;
        double r13187 = sin(r13177);
        double r13188 = r13177 - r13187;
        double r13189 = r13186 / r13188;
        double r13190 = r13184 / r13189;
        double r13191 = 0.225;
        double r13192 = 2.0;
        double r13193 = pow(r13177, r13192);
        double r13194 = r13191 * r13193;
        double r13195 = 0.009642857142857142;
        double r13196 = 4.0;
        double r13197 = pow(r13177, r13196);
        double r13198 = r13195 * r13197;
        double r13199 = 0.5;
        double r13200 = r13198 + r13199;
        double r13201 = r13194 - r13200;
        double r13202 = r13183 ? r13190 : r13201;
        return r13202;
}

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.02756549793614824 or 0.029125046562482146 < 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.02756549793614824 < x < 0.029125046562482146

    1. Initial program 63.0

      \[\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.0275654979361482401 \lor \neg \left(x \le 0.029125046562482146\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 2020045 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))